1. 14 11月, 2020 5 次提交
  2. 13 11月, 2020 15 次提交
    • J
      mac80211: free sta in sta_info_insert_finish() on errors · 7bc40aed
      Johannes Berg 提交于
      If sta_info_insert_finish() fails, we currently keep the station
      around and free it only in the caller, but there's only one such
      caller and it always frees it immediately.
      
      As syzbot found, another consequence of this split is that we can
      put things that sleep only into __cleanup_single_sta() and not in
      sta_info_free(), but this is the only place that requires such of
      sta_info_free() now.
      
      Change this to free the station in sta_info_insert_finish(), in
      which case we can still sleep. This will also let us unify the
      cleanup code later.
      
      Cc: stable@vger.kernel.org
      Fixes: dcd479e1 ("mac80211: always wind down STA state")
      Reported-by: syzbot+32c6c38c4812d22f2f0b@syzkaller.appspotmail.com
      Reported-by: syzbot+4c81fe92e372d26c4246@syzkaller.appspotmail.com
      Reported-by: syzbot+6a7fe9faf0d1d61bc24a@syzkaller.appspotmail.com
      Reported-by: syzbot+abed06851c5ffe010921@syzkaller.appspotmail.com
      Reported-by: syzbot+b7aeb9318541a1c709f1@syzkaller.appspotmail.com
      Reported-by: syzbot+d5a9416c6cafe53b5dd0@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/20201112112201.ee6b397b9453.I9c31d667a0ea2151441cc64ed6613d36c18a48e0@changeidSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      7bc40aed
    • X
      net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request · 4ee18c17
      Xie He 提交于
      The x25_disconnect function in x25_subr.c would decrease the refcount of
      "x25->neighbour" (struct x25_neigh) and reset this pointer to NULL.
      
      However, the x25_rx_call_request function in af_x25.c, which is called
      when we receive a connection request, does not increase the refcount when
      it assigns the pointer.
      
      Fix this issue by increasing the refcount of "struct x25_neigh" in
      x25_rx_call_request.
      
      This patch fixes frequent kernel crashes when using AF_X25 sockets.
      
      Fixes: 4becb7ee ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: NXie He <xie.he.0141@gmail.com>
      Link: https://lore.kernel.org/r/20201112103506.5875-1-xie.he.0141@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      4ee18c17
    • Z
      net: ethernet: mtk-star-emac: fix error return code in mtk_star_enable() · baee1991
      Zhang Changzhong 提交于
      Fix to return a negative error code from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: 8c7bd5a4 ("net: ethernet: mtk-star-emac: new driver")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
      Acked-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Link: https://lore.kernel.org/r/1605180879-2573-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      baee1991
    • V
      net: ethernet: mtk-star-emac: return ok when xmit drops · e8aa6d52
      Vincent Stehlé 提交于
      The ndo_start_xmit() method must return NETDEV_TX_OK if the DMA mapping
      fails, after freeing the socket buffer.
      Fix the mtk_star_netdev_start_xmit() function accordingly.
      
      Fixes: 8c7bd5a4 ("net: ethernet: mtk-star-emac: new driver")
      Signed-off-by: NVincent Stehlé <vincent.stehle@laposte.net>
      Acked-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Link: https://lore.kernel.org/r/20201112084833.21842-1-vincent.stehle@laposte.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      e8aa6d52
    • J
      net/ncsi: Fix netlink registration · 1922a46b
      Joel Stanley 提交于
      If a user unbinds and re-binds a NC-SI aware driver the kernel will
      attempt to register the netlink interface at runtime. The structure is
      marked __ro_after_init so registration fails spectacularly at this point.
      
       # echo 1e660000.ethernet > /sys/bus/platform/drivers/ftgmac100/unbind
       # echo 1e660000.ethernet > /sys/bus/platform/drivers/ftgmac100/bind
        ftgmac100 1e660000.ethernet: Read MAC address 52:54:00:12:34:56 from chip
        ftgmac100 1e660000.ethernet: Using NCSI interface
        8<--- cut here ---
        Unable to handle kernel paging request at virtual address 80a8f858
        pgd = 8c768dd6
        [80a8f858] *pgd=80a0841e(bad)
        Internal error: Oops: 80d [#1] SMP ARM
        CPU: 0 PID: 116 Comm: sh Not tainted 5.10.0-rc3-next-20201111-00003-gdd25b227ec1e #51
        Hardware name: Generic DT based system
        PC is at genl_register_family+0x1f8/0x6d4
        LR is at 0xff26ffff
        pc : [<8073f930>]    lr : [<ff26ffff>]    psr: 20000153
        sp : 8553bc80  ip : 81406244  fp : 8553bd04
        r10: 8085d12c  r9 : 80a8f73c  r8 : 85739000
        r7 : 00000017  r6 : 80a8f860  r5 : 80c8ab98  r4 : 80a8f858
        r3 : 00000000  r2 : 00000000  r1 : 81406130  r0 : 00000017
        Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment none
        Control: 00c5387d  Table: 85524008  DAC: 00000051
        Process sh (pid: 116, stack limit = 0x1f1988d6)
       ...
        Backtrace:
        [<8073f738>] (genl_register_family) from [<80860ac0>] (ncsi_init_netlink+0x20/0x48)
         r10:8085d12c r9:80c8fb0c r8:85739000 r7:00000000 r6:81218000 r5:85739000
         r4:8121c000
        [<80860aa0>] (ncsi_init_netlink) from [<8085d740>] (ncsi_register_dev+0x1b0/0x210)
         r5:8121c400 r4:8121c000
        [<8085d590>] (ncsi_register_dev) from [<805a8060>] (ftgmac100_probe+0x6e0/0x778)
         r10:00000004 r9:80950228 r8:8115bc10 r7:8115ab00 r6:9eae2c24 r5:813b6f88
         r4:85739000
        [<805a7980>] (ftgmac100_probe) from [<805355ec>] (platform_drv_probe+0x58/0xa8)
         r9:80c76bb0 r8:00000000 r7:80cd4974 r6:80c76bb0 r5:8115bc10 r4:00000000
        [<80535594>] (platform_drv_probe) from [<80532d58>] (really_probe+0x204/0x514)
         r7:80cd4974 r6:00000000 r5:80cd4868 r4:8115bc10
      
      Jakub pointed out that ncsi_register_dev is obviously broken, because
      there is only one family so it would never work if there was more than
      one ncsi netdev.
      
      Fix the crash by registering the netlink family once on boot, and drop
      the code to unregister it.
      
      Fixes: 955dc68c ("net/ncsi: Add generic netlink family")
      Signed-off-by: NJoel Stanley <joel@jms.id.au>
      Reviewed-by: NSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Link: https://lore.kernel.org/r/20201112061210.914621-1-joel@jms.id.auSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      1922a46b
    • L
      Merge tag 'net-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · db7c9535
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Current release - regressions:
      
         - arm64: dts: fsl-ls1028a-kontron-sl28: specify in-band mode for
           ENETC
      
        Current release - bugs in new features:
      
         - mptcp: provide rmem[0] limit offset to fix oops
      
        Previous release - regressions:
      
         - IPv6: Set SIT tunnel hard_header_len to zero to fix path MTU
           calculations
      
         - lan743x: correctly handle chips with internal PHY
      
         - bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE
      
         - mlx5e: Fix VXLAN port table synchronization after function reload
      
        Previous release - always broken:
      
         - bpf: Zero-fill re-used per-cpu map element
      
         - fix out-of-order UDP packets when forwarding with UDP GSO fraglists
           turned on:
             - fix UDP header access on Fast/frag0 UDP GRO
             - fix IP header access and skb lookup on Fast/frag0 UDP GRO
      
         - ethtool: netlink: add missing netdev_features_change() call
      
         - net: Update window_clamp if SOCK_RCVBUF is set
      
         - igc: Fix returning wrong statistics
      
         - ch_ktls: fix multiple leaks and corner cases in Chelsio TLS offload
      
         - tunnels: Fix off-by-one in lower MTU bounds for ICMP/ICMPv6 replies
      
         - r8169: disable hw csum for short packets on all chip versions
      
         - vrf: Fix fast path output packet handling with async Netfilter
           rules"
      
      * tag 'net-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits)
        lan743x: fix use of uninitialized variable
        net: udp: fix IP header access and skb lookup on Fast/frag0 UDP GRO
        net: udp: fix UDP header access on Fast/frag0 UDP GRO
        devlink: Avoid overwriting port attributes of registered port
        vrf: Fix fast path output packet handling with async Netfilter rules
        cosa: Add missing kfree in error path of cosa_write
        net: switch to the kernel.org patchwork instance
        ch_ktls: stop the txq if reaches threshold
        ch_ktls: tcb update fails sometimes
        ch_ktls/cxgb4: handle partial tag alone SKBs
        ch_ktls: don't free skb before sending FIN
        ch_ktls: packet handling prior to start marker
        ch_ktls: Correction in middle record handling
        ch_ktls: missing handling of header alone
        ch_ktls: Correction in trimmed_len calculation
        cxgb4/ch_ktls: creating skbs causes panic
        ch_ktls: Update cheksum information
        ch_ktls: Correction in finding correct length
        cxgb4/ch_ktls: decrypted bit is not enough
        net/x25: Fix null-ptr-deref in x25_connect
        ...
      db7c9535
    • L
      Merge tag 'nfs-for-5.10-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 200f9d21
      Linus Torvalds 提交于
      Pull NFS client bugfixes from Anna Schumaker:
       "Stable fixes:
        - Fix failure to unregister shrinker
      
        Other fixes:
        - Fix unnecessary locking to clear up some contention
        - Fix listxattr receive buffer size
        - Fix default mount options for nfsroot"
      
      * tag 'nfs-for-5.10-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFS: Remove unnecessary inode lock in nfs_fsync_dir()
        NFS: Remove unnecessary inode locking in nfs_llseek_dir()
        NFS: Fix listxattr receive buffer size
        NFSv4.2: fix failure to unregister shrinker
        nfsroot: Default mount option should ask for built-in NFS version
      200f9d21
    • L
      Merge tag 'acpi-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · af5043c8
      Linus Torvalds 提交于
      Pull ACPI fixes from Rafael Wysocki:
       "These are mostly docmentation fixes and janitorial changes plus some
        new device IDs and a new quirk.
      
        Specifics:
      
         - Fix documentation regarding GPIO properties (Andy Shevchenko)
      
         - Fix spelling mistakes in ACPI documentation (Flavio Suligoi)
      
         - Fix white space inconsistencies in ACPI code (Maximilian Luz)
      
         - Fix string formatting in the ACPI Generic Event Device (GED) driver
           (Nick Desaulniers)
      
         - Add Intel Alder Lake device IDs to the ACPI drivers used by the
           Dynamic Platform and Thermal Framework (Srinivas Pandruvada)
      
         - Add lid-related DMI quirk for Medion Akoya E2228T to the ACPI
           button driver (Hans de Goede)"
      
      * tag 'acpi-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: DPTF: Support Alder Lake
        Documentation: ACPI: fix spelling mistakes
        ACPI: button: Add DMI quirk for Medion Akoya E2228T
        ACPI: GED: fix -Wformat
        ACPI: Fix whitespace inconsistencies
        ACPI: scan: Fix acpi_dma_configure_id() kerneldoc name
        Documentation: firmware-guide: gpio-properties: Clarify initial output state
        Documentation: firmware-guide: gpio-properties: active_low only for GpioIo()
        Documentation: firmware-guide: gpio-properties: Fix factual mistakes
      af5043c8
    • L
      Merge tag 'pm-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · fcfb6791
      Linus Torvalds 提交于
      Pull power management fixes from Rafael Wysocki:
       "Make the intel_pstate driver behave as expected when it operates in
        the passive mode with HWP enabled and the 'powersave' governor on top
        of it"
      
      * tag 'pm-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: intel_pstate: Take CPUFREQ_GOV_STRICT_TARGET into account
        cpufreq: Add strict_target to struct cpufreq_policy
        cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET
        cpufreq: Introduce governor flags
      fcfb6791
    • S
      lan743x: fix use of uninitialized variable · edbc2111
      Sven Van Asbroeck 提交于
      When no devicetree is present, the driver will use an
      uninitialized variable.
      
      Fix by initializing this variable.
      
      Fixes: 902a66e0 ("lan743x: correctly handle chips with internal PHY")
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201112152513.1941-1-TheSven73@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      edbc2111
    • J
      Merge branch 'net-udp-fix-fast-frag0-udp-gro' · 5861c8cb
      Jakub Kicinski 提交于
      Alexander Lobakin says:
      
      ====================
      net: udp: fix Fast/frag0 UDP GRO
      
      While testing UDP GSO fraglists forwarding through driver that uses
      Fast GRO (via napi_gro_frags()), I was observing lots of out-of-order
      iperf packets:
      
      [ ID] Interval           Transfer     Bitrate         Jitter
      [SUM]  0.0-40.0 sec  12106 datagrams received out-of-order
      
      Simple switch to napi_gro_receive() or any other method without frag0
      shortcut completely resolved them.
      
      I've found two incorrect header accesses in GRO receive callback(s):
       - udp_hdr() (instead of udp_gro_udphdr()) that always points to junk
         in "fast" mode and could probably do this in "regular".
         This was the actual bug that caused all out-of-order delivers;
       - udp{4,6}_lib_lookup_skb() -> ip{,v6}_hdr() (instead of
         skb_gro_network_header()) that potentionally might return odd
         pointers in both modes.
      
      Each patch addresses one of these two issues.
      
      This doesn't cover a support for nested tunnels as it's out of the
      subject and requires more invasive changes. It will be handled
      separately in net-next series.
      
      Credits:
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Willem de Bruijn <willemb@google.com>
      
      Since v4 [0]:
       - split the fix into two logical ones (Willem);
       - replace ternaries with plain ifs to beautify the code (Jakub);
       - drop p->data part to reintroduce it later in abovementioned set.
      
      Since v3 [1]:
       - restore the original {,__}udp{4,6}_lib_lookup_skb() and use
         private versions of them inside GRO code (Willem).
      
      Since v2 [2]:
       - dropped redundant check introduced in v2 as it's performed right
         before (thanks to Eric);
       - udp_hdr() switched to data + off for skbs from list (also Eric);
       - fixed possible malfunction of {,__}udp{4,6}_lib_lookup_skb() with
         Fast/frag0 due to ip{,v6}_hdr() usage (Willem).
      
      Since v1 [3]:
       - added a NULL pointer check for "uh" as suggested by Willem.
      
      [0] https://lore.kernel.org/netdev/Ha2hou5eJPcblo4abjAqxZRzIl1RaLs2Hy0oOAgFs@cp4-web-036.plabs.ch
      [1] https://lore.kernel.org/netdev/MgZce9htmEtCtHg7pmWxXXfdhmQ6AHrnltXC41zOoo@cp7-web-042.plabs.ch
      [2] https://lore.kernel.org/netdev/0eaG8xtbtKY1dEKCTKUBubGiC9QawGgB3tVZtNqVdY@cp4-web-030.plabs.ch
      [3] https://lore.kernel.org/netdev/YazU6GEzBdpyZMDMwJirxDX7B4sualpDG68ADZYvJI@cp4-web-034.plabs.ch
      ====================
      
      Link: https://lore.kernel.org/r/hjGOh0iCOYyo1FPiZh6TMXcx3YCgNs1T1eGKLrDz8@cp4-web-037.plabs.chSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5861c8cb
    • A
      net: udp: fix IP header access and skb lookup on Fast/frag0 UDP GRO · 55e72988
      Alexander Lobakin 提交于
      udp{4,6}_lib_lookup_skb() use ip{,v6}_hdr() to get IP header of the
      packet. While it's probably OK for non-frag0 paths, this helpers
      will also point to junk on Fast/frag0 GRO when all headers are
      located in frags. As a result, sk/skb lookup may fail or give wrong
      results. To support both GRO modes, skb_gro_network_header() might
      be used. To not modify original functions, add private versions of
      udp{4,6}_lib_lookup_skb() only to perform correct sk lookups on GRO.
      
      Present since the introduction of "application-level" UDP GRO
      in 4.7-rc1.
      
      Misc: replace totally unneeded ternaries with plain ifs.
      
      Fixes: a6024562 ("udp: Add GRO functions to UDP socket")
      Suggested-by: NWillem de Bruijn <willemb@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: NAlexander Lobakin <alobakin@pm.me>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      55e72988
    • A
      net: udp: fix UDP header access on Fast/frag0 UDP GRO · 4b1a8628
      Alexander Lobakin 提交于
      UDP GRO uses udp_hdr(skb) in its .gro_receive() callback. While it's
      probably OK for non-frag0 paths (when all headers or even the entire
      frame are already in skb head), this inline points to junk when
      using Fast GRO (napi_gro_frags() or napi_gro_receive() with only
      Ethernet header in skb head and all the rest in the frags) and breaks
      GRO packet compilation and the packet flow itself.
      To support both modes, skb_gro_header_fast() + skb_gro_header_slow()
      are typically used. UDP even has an inline helper that makes use of
      them, udp_gro_udphdr(). Use that instead of troublemaking udp_hdr()
      to get rid of the out-of-order delivers.
      
      Present since the introduction of plain UDP GRO in 5.0-rc1.
      
      Fixes: e20cf8d3 ("udp: implement GRO for plain UDP sockets.")
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: NAlexander Lobakin <alobakin@pm.me>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4b1a8628
    • J
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 8a5c2906
      Jakub Kicinski 提交于
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2020-11-10
      
      This series contains updates to i40e and igc drivers and the MAINTAINERS
      file.
      
      Slawomir fixes updating VF MAC addresses to fix various issues related
      to reporting and setting of these addresses for i40e.
      
      Dan Carpenter fixes a possible used before being initialized issue for
      i40e.
      
      Vinicius fixes reporting of netdev stats for igc.
      
      Tony updates repositories for Intel Ethernet Drivers.
      
      * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        MAINTAINERS: Update repositories for Intel Ethernet Drivers
        igc: Fix returning wrong statistics
        i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc()
        i40e: Fix MAC address setting for a VF via Host/VM
      ====================
      
      Link: https://lore.kernel.org/r/20201111001955.533210-1-anthony.l.nguyen@intel.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      8a5c2906
    • P
      devlink: Avoid overwriting port attributes of registered port · 9f73bd1c
      Parav Pandit 提交于
      Cited commit in fixes tag overwrites the port attributes for the
      registered port.
      
      Avoid such error by checking registered flag before setting attributes.
      
      Fixes: 71ad8d55 ("devlink: Replace devlink_port_attrs_set parameters with a struct")
      Signed-off-by: NParav Pandit <parav@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20201111034744.35554-1-parav@nvidia.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      9f73bd1c
  3. 12 11月, 2020 20 次提交