1. 03 4月, 2023 1 次提交
  2. 27 3月, 2023 1 次提交
  3. 26 10月, 2022 1 次提交
    • K
      net: dev: Convert sa_data to flexible array in struct sockaddr · b5f0de6d
      Kees Cook 提交于
      One of the worst offenders of "fake flexible arrays" is struct sockaddr,
      as it is the classic example of why GCC and Clang have been traditionally
      forced to treat all trailing arrays as fake flexible arrays: in the
      distant misty past, sa_data became too small, and code started just
      treating it as a flexible array, even though it was fixed-size. The
      special case by the compiler is specifically that sizeof(sa->sa_data)
      and FORTIFY_SOURCE (which uses __builtin_object_size(sa->sa_data, 1))
      do not agree (14 and -1 respectively), which makes FORTIFY_SOURCE treat
      it as a flexible array.
      
      However, the coming -fstrict-flex-arrays compiler flag will remove
      these special cases so that FORTIFY_SOURCE can gain coverage over all
      the trailing arrays in the kernel that are _not_ supposed to be treated
      as a flexible array. To deal with this change, convert sa_data to a true
      flexible array. To keep the structure size the same, move sa_data into
      a union with a newly introduced sa_data_min with the original size. The
      result is that FORTIFY_SOURCE can continue to have no idea how large
      sa_data may actually be, but anything using sizeof(sa->sa_data) must
      switch to sizeof(sa->sa_data_min).
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Pavel Begunkov <asml.silence@gmail.com>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Dylan Yudaken <dylany@fb.com>
      Cc: Yajun Deng <yajun.deng@linux.dev>
      Cc: Petr Machata <petrm@nvidia.com>
      Cc: Hangbin Liu <liuhangbin@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: syzbot <syzkaller@googlegroups.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20221018095503.never.671-kees@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      b5f0de6d
  4. 10 6月, 2022 1 次提交
  5. 08 4月, 2022 1 次提交
    • J
      net: extract a few internals from netdevice.h · 6264f58c
      Jakub Kicinski 提交于
      There's a number of functions and static variables used
      under net/core/ but not from the outside. We currently
      dump most of them into netdevice.h. That bad for many
      reasons:
       - netdevice.h is very cluttered, hard to figure out
         what the APIs are;
       - netdevice.h is very long;
       - we have to touch netdevice.h more which causes expensive
         incremental builds.
      
      Create a header under net/core/ and move some declarations.
      
      The new header is also a bit of a catch-all but that's
      fine, if we create more specific headers people will
      likely over-think where their declaration fit best.
      And end up putting them in netdevice.h, again.
      
      More work should be done on splitting netdevice.h into more
      targeted headers, but that'd be more time consuming so small
      steps.
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      6264f58c
  6. 14 12月, 2021 1 次提交
    • H
      net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX · 9c9211a3
      Hangbin Liu 提交于
      Since commit 94dd016a ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP
      ioctl to active device") the user could get bond active interface's
      PHC index directly. But when there is a failover, the bond active
      interface will change, thus the PHC index is also changed. This may
      break the user's program if they did not update the PHC timely.
      
      This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
      When the user wants to get the bond active interface's PHC, they need to
      add this flag and be aware the PHC index may be changed.
      
      With the new flag. All flag checks in current drivers are removed. Only
      the checking in net_hwtstamp_validate() is kept.
      Suggested-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c9211a3
  7. 07 12月, 2021 1 次提交
  8. 01 11月, 2021 1 次提交
  9. 05 8月, 2021 2 次提交
    • N
      net: core: don't call SIOCBRADD/DELIF for non-bridge devices · 9384eacd
      Nikolay Aleksandrov 提交于
      Commit ad2f99ae ("net: bridge: move bridge ioctls out of .ndo_do_ioctl")
      changed SIOCBRADD/DELIF to use bridge's ioctl hook (br_ioctl_hook)
      without checking if the target netdevice is actually a bridge which can
      cause crashes and generally interpreting other devices' private pointers
      as net_bridge pointers.
      
      Crash example (lo - loopback):
      $ brctl addif lo ens16
       BUG: kernel NULL pointer dereference, address: 000000000000059898
       #PF: supervisor read access in kernel modede
       #PF: error_code(0x0000) - not-present pagege
       PGD 0 P4D 0 ^Ac
       Oops: 0000 [#1] SMP NOPTI
       CPU: 2 PID: 1376 Comm: brctl Kdump: loaded Tainted: G        W         5.14.0-rc3+ #405
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014
       RIP: 0010:add_del_if+0x1f/0x7c [bridge]
       Code: 80 bf 1b a0 41 5c e9 c0 3c 03 e1 0f 1f 44 00 00 41 55 41 54 41 89 f4 be 0c 00 00 00 55 48 89 fd 53 48 8b 87 88 00 00 00 89 d3 <4c> 8b a8 98 05 00 00 49 8b bd d0 00 00 00 e8 17 d7 f3 e0 84 c0 74
       RSP: 0018:ffff888109d97cb0 EFLAGS: 00010202^Ac
       RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: 000000000000000c RDI: ffff888101239bc0
       RBP: ffff888101239bc0 R08: 0000000000000001 R09: 0000000000000000
       R10: ffff888109d97cd8 R11: 00000000000000a3 R12: 0000000000000012
       R13: 0000000000000000 R14: ffff888101239bc0 R15: ffff888109d97e10
       FS:  00007fc1e365b540(0000) GS:ffff88822be80000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000598 CR3: 0000000106506000 CR4: 00000000000006e0
       Call Trace:
        br_ioctl_stub+0x7c/0x441 [bridge]
        br_ioctl_call+0x6d/0x8a
        dev_ifsioc+0x325/0x4e8
        dev_ioctl+0x46b/0x4e1
        sock_do_ioctl+0x7b/0xad
        sock_ioctl+0x2de/0x2f2
        vfs_ioctl+0x1e/0x2b
        __do_sys_ioctl+0x63/0x86
        do_syscall_64+0xcb/0xf2
        entry_SYSCALL_64_after_hwframe+0x44/0xae
       RIP: 0033:0x7fc1e3589427
       Code: 00 00 90 48 8b 05 69 aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 39 aa 0c 00 f7 d8 64 89 01 48
       RSP: 002b:00007ffc8d501d38 EFLAGS: 00000202 ORIG_RAX: 000000000000001010
       RAX: ffffffffffffffda RBX: 0000000000000012 RCX: 00007fc1e3589427
       RDX: 00007ffc8d501d60 RSI: 00000000000089a3 RDI: 0000000000000003
       RBP: 00007ffc8d501d60 R08: 0000000000000000 R09: fefefeff77686d74
       R10: fffffffffffff8f9 R11: 0000000000000202 R12: 00007ffc8d502e06
       R13: 00007ffc8d502e06 R14: 0000000000000000 R15: 0000000000000000
       Modules linked in: bridge stp llc bonding ipv6 virtio_net [last unloaded: llc]^Ac
       CR2: 0000000000000598
      
      Reported-by: syzbot+79f4a8692e267bdb7227@syzkaller.appspotmail.com
      Fixes: ad2f99ae ("net: bridge: move bridge ioctls out of .ndo_do_ioctl")
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9384eacd
    • N
      net: bridge: fix ioctl locking · 893b1958
      Nikolay Aleksandrov 提交于
      Before commit ad2f99ae ("net: bridge: move bridge ioctls out of
      .ndo_do_ioctl") the bridge ioctl calls were divided in two parts:
      one was deviceless called by sock_ioctl and didn't expect rtnl to be held,
      the other was with a device called by dev_ifsioc() and expected rtnl to be
      held. After the commit above they were united in a single ioctl stub, but
      it didn't take care of the locking expectations.
      For sock_ioctl now we acquire  (1) br_ioctl_mutex, (2) rtnl
      and for dev_ifsioc we acquire  (1) rtnl,           (2) br_ioctl_mutex
      
      The fix is to get a refcnt on the netdev for dev_ifsioc calls and drop rtnl
      then to reacquire it in the bridge ioctl stub after br_ioctl_mutex has
      been acquired. That will avoid playing locking games and make the rules
      straight-forward: we always take br_ioctl_mutex first, and then rtnl.
      
      Reported-by: syzbot+34fe5894623c4ab1b379@syzkaller.appspotmail.com
      Fixes: ad2f99ae ("net: bridge: move bridge ioctls out of .ndo_do_ioctl")
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      893b1958
  10. 28 7月, 2021 7 次提交
    • A
      net: bonding: move ioctl handling to private ndo operation · 3d9d00bd
      Arnd Bergmann 提交于
      All other user triggered operations are gone from ndo_ioctl, so move
      the SIOCBOND family into a custom operation as well.
      
      The .ndo_ioctl() helper is no longer called by the dev_ioctl.c code now,
      but there are still a few definitions in obsolete wireless drivers as well
      as the appletalk and ieee802154 layers to call SIOCSIFADDR/SIOCGIFADDR
      helpers from inside the kernel.
      
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d9d00bd
    • A
      net: bridge: move bridge ioctls out of .ndo_do_ioctl · ad2f99ae
      Arnd Bergmann 提交于
      Working towards obsoleting the .ndo_do_ioctl operation entirely,
      stop passing the SIOCBRADDIF/SIOCBRDELIF device ioctl commands
      into this callback.
      
      My first attempt was to add another ndo_siocbr() callback, but
      as there is only a single driver that takes these commands and
      there is already a hook mechanism to call directly into this
      driver, extend this hook instead, and use it for both the
      deviceless and the device specific ioctl commands.
      
      Cc: Roopa Prabhu <roopa@nvidia.com>
      Cc: Nikolay Aleksandrov <nikolay@nvidia.com>
      Cc: bridge@lists.linux-foundation.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ad2f99ae
    • A
      net: socket: return changed ifreq from SIOCDEVPRIVATE · 88fc023f
      Arnd Bergmann 提交于
      Some drivers that use SIOCDEVPRIVATE ioctl commands modify
      the ifreq structure and expect it to be passed back to user
      space, which has never really happened for compat mode
      because the calling these drivers through ndo_do_ioctl
      requires overwriting the ifr_data pointer.
      
      Now that all drivers are converted to ndo_siocdevprivate,
      change it to handle this correctly in both compat and
      native mode.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88fc023f
    • A
      net: split out ndo_siowandev ioctl · ad7eab2a
      Arnd Bergmann 提交于
      In order to further reduce the scope of ndo_do_ioctl(), move
      out the SIOCWANDEV handling into a new network device operation
      function.
      
      Adjust the prototype to only pass the if_settings sub-structure
      in place of the ifreq, and remove the redundant 'cmd' argument
      in the process.
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: "Jan \"Yenya\" Kasprzak" <kas@fi.muni.cz>
      Cc: Kevin Curtis <kevin.curtis@farsite.co.uk>
      Cc: Zhao Qiang <qiang.zhao@nxp.com>
      Cc: Martin Schiller <ms@dev.tdt.de>
      Cc: Jiri Slaby <jirislaby@kernel.org>
      Cc: linux-x25@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ad7eab2a
    • A
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann 提交于
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7605370
    • A
      dev_ioctl: pass SIOCDEVPRIVATE data separately · a554bf96
      Arnd Bergmann 提交于
      The compat handlers for SIOCDEVPRIVATE are incorrect for any driver that
      passes data as part of struct ifreq rather than as an ifr_data pointer, or
      that passes data back this way, since the compat_ifr_data_ioctl() helper
      overwrites the ifr_data pointer and does not copy anything back out.
      
      Since all drivers using devprivate commands are now converted to the
      new .ndo_siocdevprivate callback, fix this by adding the missing piece
      and passing the pointer separately the whole way.
      
      This further unifies the native and compat logic for socket ioctls,
      as the new code now passes the correct pointer as well as the correct
      data for both native and compat ioctls.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a554bf96
    • A
      net: split out SIOCDEVPRIVATE handling from dev_ioctl · b9067f5d
      Arnd Bergmann 提交于
      SIOCDEVPRIVATE ioctl commands are mainly used in really old
      drivers, and they have a number of problems:
      
      - They hide behind the normal .ndo_do_ioctl function that
        is also used for other things in modern drivers, so it's
        hard to spot a driver that actually uses one of these
      
      - Since drivers use a number different calling conventions,
        it is impossible to support compat mode for them in
        a generic way.
      
      - With all drivers using the same 16 commands codes, there
        is no way to introspect the data being passed through
        things like strace.
      
      Add a new net_device_ops callback pointer, to address the
      first two of these. Separating them from .ndo_do_ioctl
      makes it easy to grep for drivers with a .ndo_siocdevprivate
      callback, and the unwieldy name hopefully makes it easier
      to spot in code review.
      
      By passing the ifreq structure and the ifr_data pointer
      separately, it is no longer necessary to overload these,
      and the driver can use either one for a given command.
      
      Cc: Cong Wang <cong.wang@bytedance.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9067f5d
  11. 23 7月, 2021 3 次提交
  12. 12 2月, 2021 1 次提交
    • C
      net: fix dev_ifsioc_locked() race condition · 3b23a32a
      Cong Wang 提交于
      dev_ifsioc_locked() is called with only RCU read lock, so when
      there is a parallel writer changing the mac address, it could
      get a partially updated mac address, as shown below:
      
      Thread 1			Thread 2
      // eth_commit_mac_addr_change()
      memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
      				// dev_ifsioc_locked()
      				memcpy(ifr->ifr_hwaddr.sa_data,
      					dev->dev_addr,...);
      
      Close this race condition by guarding them with a RW semaphore,
      like netdev_get_name(). We can not use seqlock here as it does not
      allow blocking. The writers already take RTNL anyway, so this does
      not affect the slow path. To avoid bothering existing
      dev_set_mac_address() callers in drivers, introduce a new wrapper
      just for user-facing callers on ioctl and rtnetlink paths.
      
      Note, bonding also changes slave mac addresses but that requires
      a separate patch due to the complexity of bonding code.
      
      Fixes: 3710becf ("net: RCU locking for simple ioctl()")
      Reported-by: N"Gong, Sishuai" <sishuai@purdue.edu>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: NCong Wang <cong.wang@bytedance.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3b23a32a
  13. 04 11月, 2020 1 次提交
  14. 24 8月, 2020 1 次提交
  15. 21 7月, 2020 2 次提交
  16. 30 3月, 2020 1 次提交
  17. 26 12月, 2019 1 次提交
  18. 28 3月, 2019 1 次提交
    • B
      net/core: Document all dev_ioctl() arguments · b3c0fd61
      Bart Van Assche 提交于
      This patch avoids that the following warnings are reported when building
      with W=1:
      
      net/core/dev_ioctl.c:378: warning: Function parameter or member 'ifr' not described in 'dev_ioctl'
      net/core/dev_ioctl.c:378: warning: Function parameter or member 'need_copyout' not described in 'dev_ioctl'
      net/core/dev_ioctl.c:378: warning: Excess function parameter 'arg' description in 'dev_ioctl'
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Fixes: 44c02a2c ("dev_ioctl(): move copyin/copyout to callers") # v4.16.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3c0fd61
  19. 14 12月, 2018 1 次提交
  20. 07 12月, 2018 1 次提交
  21. 25 7月, 2018 1 次提交
    • T
      net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc · 8dd30201
      Tariq Toukan 提交于
      The cited patch added a call to dev_change_tx_queue_len in
      SIOCSIFTXQLEN case.
      This obsoletes the new len comparison check done before the function call.
      Remove it here.
      
      For the desicion of keep/remove the negative value check, we examine the
      range check in dev_change_tx_queue_len.
      On 64-bit we will fail with -ERANGE.  The 32-bit int ifr_qlen will be sign
      extended to 64-bits when it is passed into dev_change_tx_queue_len(). And
      then for negative values this test triggers:
      
      	if (new_len != (unsigned int)new_len)
      		return -ERANGE;
      
      because:
      	if (0xffffffffWHATEVER != 0x00000000WHATEVER)
      
      On 32-bit the signed value will be accepted, changing behavior.
      
      Therefore, the negative value check is kept.
      
      Fixes: 3f76df19 ("net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN")
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Reviewed-by: NEran Ben Elisha <eranbe@mellanox.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8dd30201
  22. 30 6月, 2018 1 次提交
  23. 08 3月, 2018 1 次提交
  24. 25 1月, 2018 3 次提交
  25. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  26. 17 10月, 2017 1 次提交
  27. 30 7月, 2017 1 次提交
    • W
      net: check dev->addr_len for dev_set_mac_address() · 0254e0c6
      WANG Cong 提交于
      Historically, dev_ifsioc() uses struct sockaddr as mac
      address definition, this is why dev_set_mac_address()
      accepts a struct sockaddr pointer as input but now we
      have various types of mac addresse whose lengths
      are up to MAX_ADDR_LEN, longer than struct sockaddr,
      and saved in dev->addr_len.
      
      It is too late to fix dev_ifsioc() due to API
      compatibility, so just reject those larger than
      sizeof(struct sockaddr), otherwise we would read
      and use some random bytes from kernel stack.
      
      Fortunately, only a few IPv6 tunnel devices have addr_len
      larger than sizeof(struct sockaddr) and they don't support
      ndo_set_mac_addr(). But with team driver, in lb mode, they
      can still be enslaved to a team master and make its mac addr
      length as the same.
      
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0254e0c6
  28. 20 7月, 2017 1 次提交