1. 19 Aug, 2020 10 commits
  2. 18 Aug, 2020 9 commits
    • Miaohe Lin's avatar
      net: eliminate meaningless memcpy to data in pskb_carve_inside_nonlinear() · e3ec1e8c
      Miaohe Lin authored
      The frags of skb_shared_info of the data is assigned in following loop. It
      is meaningless to do a memcpy of frags here.
      Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3ec1e8c
    • Alex Dewar's avatar
      ethernet: cirrus: Remove unused macros · 46191546
      Alex Dewar authored
      Remove a couple of unused #defines in cs89x0.h.
      Signed-off-by: default avatarAlex Dewar <alex.dewar90@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46191546
    • Miaohe Lin's avatar
      net: tipc: Convert to use the preferred fallthrough macro · 7f8901b7
      Miaohe Lin authored
      Convert the uses of fallthrough comments to fallthrough macro.
      Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f8901b7
    • David S. Miller's avatar
      Merge branch 'netlink-allow-NLA_BINARY-length-range-validation' · 396fc59e
      David S. Miller authored
      Johannes Berg says:
      
      ====================
      netlink: allow NLA_BINARY length range validation
      
      In quite a few places (perhaps particularly in wireless) we need to
      validation an NLA_BINARY attribute with both a minimum and a maximum
      length. Currently, we can do either of the two, but not both, given
      that we have NLA_MIN_LEN (minimum length) and NLA_BINARY (maximum).
      
      Extend the range mechanisms that we use for integer validation to
      apply to NLA_BINARY as well.
      
      After converting everything to use NLA_POLICY_MIN_LEN() we can thus
      get rid of the NLA_MIN_LEN type since that's now a special case of
      NLA_BINARY with a minimum length validation. Similarly, NLA_EXACT_LEN
      can be specified using NLA_POLICY_EXACT_LEN() and also maps to the
      new NLA_BINARY validation (min == max == desired length).
      
      Finally, NLA_POLICY_EXACT_LEN_WARN() also gets to be a somewhat
      special case of this.
      
      I haven't included the patch here now that converts nl82011 to use
      this because it doesn't apply without another cleanup patch, but
      we can remove a number of hand-coded min/max length checks and get
      better error messages from the general validation code while doing
      that.
      
      As I had originally built the netlink policy export to userspace in
      a way that has min/max length for NLA_BINARY (for the types that we
      used to call NLA_MIN_LEN, NLA_BINARY and NLA_EXACT_LEN) anyway, it
      doesn't really change anything there except that now there's a chance
      that userspace sees min length < max length, which previously wasn't
      possible.
      
      v2:
       * fix the min<max comment to correctly say min<=max
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      396fc59e
    • Johannes Berg's avatar
      netlink: make NLA_BINARY validation more flexible · 8aa26c57
      Johannes Berg authored
      Add range validation for NLA_BINARY, allowing validation of any
      combination of combination minimum or maximum lengths, using the
      existing NLA_POLICY_RANGE()/NLA_POLICY_FULL_RANGE() macros, just
      like for integers where the value is checked.
      
      Also make NLA_POLICY_EXACT_LEN(), NLA_POLICY_EXACT_LEN_WARN()
      and NLA_POLICY_MIN_LEN() special cases of this, removing the old
      types NLA_EXACT_LEN and NLA_MIN_LEN.
      
      This allows us to save some code where both minimum and maximum
      lengths are requires, currently the policy only allows maximum
      (NLA_BINARY), minimum (NLA_MIN_LEN) or exact (NLA_EXACT_LEN), so
      a range of lengths cannot be accepted and must be checked by the
      code that consumes the attributes later.
      
      Also, this allows advertising the correct ranges in the policy
      export to userspace. Here, NLA_MIN_LEN and NLA_EXACT_LEN already
      were special cases of NLA_BINARY with min and min/max length
      respectively.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8aa26c57
    • Johannes Berg's avatar
      netlink: consistently use NLA_POLICY_MIN_LEN() · bc043585
      Johannes Berg authored
      Change places that open-code NLA_POLICY_MIN_LEN() to
      use the macro instead, giving us flexibility in how we
      handle the details of the macro.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc043585
    • Johannes Berg's avatar
      netlink: consistently use NLA_POLICY_EXACT_LEN() · 8140860c
      Johannes Berg authored
      Change places that open-code NLA_POLICY_EXACT_LEN() to
      use the macro instead, giving us flexibility in how we
      handle the details of the macro.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8140860c
    • Linus Torvalds's avatar
      Merge tag 'pstore-v5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 06a4ec1d
      Linus Torvalds authored
      Pull mailmap update from Kees Cook:
       "This was originally part of my pstore tree, but when I realized that
        mailmap needed re-alphabetizing, I decided to wait until -rc1 to send
        this, as I saw a lot of mailmap additions pending in -next for the
        merge window.
      
        It's a programmatic reordering and the addition of a pstore
        contributor's preferred email address"
      
      * tag 'pstore-v5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        mailmap: Add WeiXiong Liao
        mailmap: Restore dictionary sorting
      06a4ec1d
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 4cf75621
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Another batch of fixes:
      
        1) Remove nft_compat counter flush optimization, it generates warnings
           from the refcount infrastructure. From Florian Westphal.
      
        2) Fix BPF to search for build id more robustly, from Jiri Olsa.
      
        3) Handle bogus getopt lengths in ebtables, from Florian Westphal.
      
        4) Infoleak and other fixes to j1939 CAN driver, from Eric Dumazet and
           Oleksij Rempel.
      
        5) Reset iter properly on mptcp sendmsg() error, from Florian
           Westphal.
      
        6) Show a saner speed in bonding broadcast mode, from Jarod Wilson.
      
        7) Various kerneldoc fixes in bonding and elsewhere, from Lee Jones.
      
        8) Fix double unregister in bonding during namespace tear down, from
           Cong Wang.
      
        9) Disable RP filter during icmp_redirect selftest, from David Ahern"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (75 commits)
        otx2_common: Use devm_kcalloc() in otx2_config_npa()
        net: qrtr: fix usage of idr in port assignment to socket
        selftests: disable rp_filter for icmp_redirect.sh
        Revert "net: xdp: pull ethernet header off packet after computing skb->protocol"
        phylink: <linux/phylink.h>: fix function prototype kernel-doc warning
        mptcp: sendmsg: reset iter on error redux
        net: devlink: Remove overzealous WARN_ON with snapshots
        tipc: not enable tipc when ipv6 works as a module
        tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
        net: Fix potential wrong skb->protocol in skb_vlan_untag()
        net: xdp: pull ethernet header off packet after computing skb->protocol
        ipvlan: fix device features
        bonding: fix a potential double-unregister
        can: j1939: add rxtimer for multipacket broadcast session
        can: j1939: abort multipacket broadcast session when timeout occurs
        can: j1939: cancel rxtimer on multipacket broadcast session complete
        can: j1939: fix support for multipacket broadcast message
        net: fddi: skfp: cfm: Remove seemingly unused variable 'ID_sccs'
        net: fddi: skfp: cfm: Remove set but unused variable 'oldstate'
        net: fddi: skfp: smt: Remove seemingly unused variable 'ID_sccs'
        ...
      4cf75621
  3. 17 Aug, 2020 12 commits
  4. 16 Aug, 2020 9 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 8c26544f
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Endianness issue in IPv4 option support in nft_exthdr,
         from Stephen Suryaputra.
      
      2) Removes the waitcount optimization in nft_compat,
         from Florian Westphal.
      
      3) Remove ipv6 -> nf_defrag_ipv6 module dependency, from
         Florian Westphal.
      
      4) Memleak in chain binding support, also from Florian.
      
      5) Simplify nft_flowtable.sh selftest, from Fabian Frederick.
      
      6) Optional MTU arguments for selftest nft_flowtable.sh,
         also from Fabian.
      
      7) Remove noise error report when killing process in
         selftest nft_flowtable.sh, from Fabian Frederick.
      
      8) Reject bogus getsockopt option length in ebtables,
         from Florian Westphal.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c26544f
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-5.9-20200815' of... · 71a50419
      David S. Miller authored
      Merge tag 'linux-can-fixes-for-5.9-20200815' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2020-08-15
      
      this is a pull request of 4 patches for net/master.
      
      All patches are by Zhang Changzhong and fix broadcast related problems in the
      j1939 CAN networking stack.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71a50419
    • Miaohe Lin's avatar
      net: Fix potential wrong skb->protocol in skb_vlan_untag() · 55eff0eb
      Miaohe Lin authored
      We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). So
      we should pull VLAN_HLEN + sizeof(unsigned short) in skb_vlan_untag() or
      we may access the wrong data.
      
      Fixes: 0d5501c1 ("net: Always untag vlan-tagged traffic on input.")
      Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55eff0eb
    • Jason A. Donenfeld's avatar
      net: xdp: pull ethernet header off packet after computing skb->protocol · f8414a8d
      Jason A. Donenfeld authored
      When an XDP program changes the ethernet header protocol field,
      eth_type_trans is used to recalculate skb->protocol. In order for
      eth_type_trans to work correctly, the ethernet header must actually be
      part of the skb data segment, so the code first pushes that onto the
      head of the skb. However, it subsequently forgets to pull it back off,
      making the behavior of the passed-on packet inconsistent between the
      protocol modifying case and the static protocol case. This patch fixes
      the issue by simply pulling the ethernet header back off of the skb
      head.
      
      Fixes: 29724956 ("net: fix generic XDP to handle if eth header was mangled")
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8414a8d
    • Mahesh Bandewar's avatar
      ipvlan: fix device features · d0f5c707
      Mahesh Bandewar authored
      Processing NETDEV_FEAT_CHANGE causes IPvlan links to lose
      NETIF_F_LLTX feature because of the incorrect handling of
      features in ipvlan_fix_features().
      
      --before--
      lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
      tx-lockless: on [fixed]
      lpaa10:~# ethtool -K ipvl0 tso off
      Cannot change tcp-segmentation-offload
      Actual changes:
      vlan-challenged: off [fixed]
      tx-lockless: off [fixed]
      lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
      tx-lockless: off [fixed]
      lpaa10:~#
      
      --after--
      lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
      tx-lockless: on [fixed]
      lpaa10:~# ethtool -K ipvl0 tso off
      Cannot change tcp-segmentation-offload
      Could not change any device features
      lpaa10:~# ethtool -k ipvl0 | grep tx-lockless
      tx-lockless: on [fixed]
      lpaa10:~#
      
      Fixes: 2ad7bf36 ("ipvlan: Initial check-in of the IPVLAN driver.")
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0f5c707
    • Cong Wang's avatar
      bonding: fix a potential double-unregister · 83270702
      Cong Wang authored
      When we tear down a network namespace, we unregister all
      the netdevices within it. So we may queue a slave device
      and a bonding device together in the same unregister queue.
      
      If the only slave device is non-ethernet, it would
      automatically unregister the bonding device as well. Thus,
      we may end up unregistering the bonding device twice.
      
      Workaround this special case by checking reg_state.
      
      Fixes: 9b5e383c ("net: Introduce unregister_netdevice_many()")
      Reported-by: syzbot+af23e7f3e0a7e10c8b67@syzkaller.appspotmail.com
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83270702
    • Linus Torvalds's avatar
      Linux 5.9-rc1 · 9123e3a7
      Linus Torvalds authored
      9123e3a7
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block · 2cc3c4b3
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few differerent things in here.
      
        Seems like syzbot got some more io_uring bits wired up, and we got a
        handful of reports and the associated fixes are in here.
      
        General fixes too, and a lot of them marked for stable.
      
        Lastly, a bit of fallout from the async buffered reads, where we now
        more easily trigger short reads. Some applications don't really like
        that, so the io_read() code now handles short reads internally, and
        got a cleanup along the way so that it's now easier to read (and
        documented). We're now passing tests that failed before"
      
      * tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block:
        io_uring: short circuit -EAGAIN for blocking read attempt
        io_uring: sanitize double poll handling
        io_uring: internally retry short reads
        io_uring: retain iov_iter state over io_read/io_write calls
        task_work: only grab task signal lock when needed
        io_uring: enable lookup of links holding inflight files
        io_uring: fail poll arm on queue proc failure
        io_uring: hold 'ctx' reference around task_work queue + execute
        fs: RWF_NOWAIT should imply IOCB_NOIO
        io_uring: defer file table grabbing request cleanup for locked requests
        io_uring: add missing REQ_F_COMP_LOCKED for nested requests
        io_uring: fix recursive completion locking on oveflow flush
        io_uring: use TWA_SIGNAL for task_work uncondtionally
        io_uring: account locked memory before potential error case
        io_uring: set ctx sq/cq entry count earlier
        io_uring: Fix NULL pointer dereference in loop_rw_iter()
        io_uring: add comments on how the async buffered read retry works
        io_uring: io_async_buf_func() need not test page bit
      2cc3c4b3
    • Mike Rapoport's avatar
      parisc: fix PMD pages allocation by restoring pmd_alloc_one() · 6f6aea7e
      Mike Rapoport authored
      Commit 1355c31e ("asm-generic: pgalloc: provide generic pmd_alloc_one()
      and pmd_free_one()") converted parisc to use generic version of
      pmd_alloc_one() but it missed the fact that parisc uses order-1 pages for
      PMD.
      
      Restore the original version of pmd_alloc_one() for parisc, just use
      GFP_PGTABLE_KERNEL that implies __GFP_ZERO instead of GFP_KERNEL and
      memset.
      
      Fixes: 1355c31e ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()")
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Link: https://lkml.kernel.org/r/9f2b5ebd-e4a4-0fa1-6cd3-4b9f6892d1ad@linux.eeSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6f6aea7e