Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 03, 2022
  2. Mar 02, 2022
  3. Mar 01, 2022
  4. Feb 28, 2022
    • Sasha Neftin's avatar
      e1000e: Correct NVM checksum verification flow · ffd24fa2
      Sasha Neftin authored
      Update MAC type check e1000_pch_tgp because for e1000_pch_cnp,
      NVM checksum update is still possible.
      Emit a more detailed warning message.
      
      Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1191663
      Fixes: 4051f683
      
       ("e1000e: Do not take care about recovery NVM checksum")
      Reported-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: default avatarSasha Neftin <sasha.neftin@intel.com>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      ffd24fa2
    • Sasha Neftin's avatar
      e1000e: Fix possible HW unit hang after an s0ix exit · 1866aa0d
      Sasha Neftin authored
      Disable the OEM bit/Gig Disable/restart AN impact and disable the PHY
      LAN connected device (LCD) reset during power management flows. This
      fixes possible HW unit hangs on the s0ix exit on some corporate ADL
      platforms.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821
      Fixes: 3e55d231
      
       ("e1000e: Add handshake with the CSME to support S0ix")
      Suggested-by: default avatarDima Ruinskiy <dima.ruinskiy@intel.com>
      Suggested-by: default avatarNir Efrati <nir.efrati@intel.com>
      Signed-off-by: default avatarSasha Neftin <sasha.neftin@intel.com>
      Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1866aa0d
    • Florian Westphal's avatar
      netfilter: egress: silence egress hook lockdep splats · 17a8f31b
      Florian Westphal authored
      
      Netfilter assumes its called with rcu_read_lock held, but in egress
      hook case it may be called with BH readlock.
      
      This triggers lockdep splat.
      
      In order to avoid to change all rcu_dereference() to
      rcu_dereference_check(..., rcu_read_lock_bh_held()), wrap nf_hook_slow
      with read lock/unlock pair.
      
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      17a8f31b
    • Eric Dumazet's avatar
      netfilter: fix use-after-free in __nf_register_net_hook() · 56763f12
      Eric Dumazet authored
      We must not dereference @new_hooks after nf_hook_mutex has been released,
      because other threads might have freed our allocated hooks already.
      
      BUG: KASAN: use-after-free in nf_hook_entries_get_hook_ops include/linux/netfilter.h:130 [inline]
      BUG: KASAN: use-after-free in hooks_validate net/netfilter/core.c:171 [inline]
      BUG: KASAN: use-after-free in __nf_register_net_hook+0x77a/0x820 net/netfilter/core.c:438
      Read of size 2 at addr ffff88801c1a8000 by task syz-executor237/4430
      
      CPU: 1 PID: 4430 Comm: syz-executor237 Not tainted 5.17.0-rc5-syzkaller-00306-g2293be58d6a1 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <TASK>
       __dump_stack lib/dump_stack.c:88 [inline]
       dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
       print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255
       __kasan_report mm/kasan/report.c:442 [inline]
       kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
       nf_hook_entries_get_hook_ops include/linux/netfilter.h:130 [inline]
       hooks_validate net/netfilter/core.c:171 [inline]
       __nf_register_net_hook+0x77a/0x820 net/netfilter/core.c:438
       nf_register_net_hook+0x114/0x170 net/netfilter/core.c:571
       nf_register_net_hooks+0x59/0xc0 net/netfilter/core.c:587
       nf_synproxy_ipv6_init+0x85/0xe0 net/netfilter/nf_synproxy_core.c:1218
       synproxy_tg6_check+0x30d/0x560 net/ipv6/netfilter/ip6t_SYNPROXY.c:81
       xt_check_target+0x26c/0x9e0 net/netfilter/x_tables.c:1038
       check_target net/ipv6/netfilter/ip6_tables.c:530 [inline]
       find_check_entry.constprop.0+0x7f1/0x9e0 net/ipv6/netfilter/ip6_tables.c:573
       translate_table+0xc8b/0x1750 net/ipv6/netfilter/ip6_tables.c:735
       do_replace net/ipv6/netfilter/ip6_tables.c:1153 [inline]
       do_ip6t_set_ctl+0x56e/0xb90 net/ipv6/netfilter/ip6_tables.c:1639
       nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101
       ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1024
       rawv6_setsockopt+0xd3/0x6a0 net/ipv6/raw.c:1084
       __sys_setsockopt+0x2db/0x610 net/socket.c:2180
       __do_sys_setsockopt net/socket.c:2191 [inline]
       __se_sys_setsockopt net/socket.c:2188 [inline]
       __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x7f65a1ace7d9
      Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007f65a1a7f308 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
      RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f65a1ace7d9
      RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003
      RBP: 00007f65a1b574c8 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000020000000 R11: 0000000000000246 R12: 00007f65a1b55130
      R13: 00007f65a1b574c0 R14: 00007f65a1b24090 R15: 0000000000022000
       </TASK>
      
      The buggy address belongs to the page:
      page:ffffea0000706a00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c1a8
      flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
      raw: 00fff00000000000 ffffea0001c1b108 ffffea000046dd08 0000000000000000
      raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      page_owner tracks the page as freed
      page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52dc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 4430, ts 1061781545818, free_ts 1061791488993
       prep_new_page mm/page_alloc.c:2434 [inline]
       get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
       __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389
       __alloc_pages_node include/linux/gfp.h:572 [inline]
       alloc_pages_node include/linux/gfp.h:595 [inline]
       kmalloc_large_node+0x62/0x130 mm/slub.c:4438
       __kmalloc_node+0x35a/0x4a0 mm/slub.c:4454
       kmalloc_node include/linux/slab.h:604 [inline]
       kvmalloc_node+0x97/0x100 mm/util.c:580
       kvmalloc include/linux/slab.h:731 [inline]
       kvzalloc include/linux/slab.h:739 [inline]
       allocate_hook_entries_size net/netfilter/core.c:61 [inline]
       nf_hook_entries_grow+0x140/0x780 net/netfilter/core.c:128
       __nf_register_net_hook+0x144/0x820 net/netfilter/core.c:429
       nf_register_net_hook+0x114/0x170 net/netfilter/core.c:571
       nf_register_net_hooks+0x59/0xc0 net/netfilter/core.c:587
       nf_synproxy_ipv6_init+0x85/0xe0 net/netfilter/nf_synproxy_core.c:1218
       synproxy_tg6_check+0x30d/0x560 net/ipv6/netfilter/ip6t_SYNPROXY.c:81
       xt_check_target+0x26c/0x9e0 net/netfilter/x_tables.c:1038
       check_target net/ipv6/netfilter/ip6_tables.c:530 [inline]
       find_check_entry.constprop.0+0x7f1/0x9e0 net/ipv6/netfilter/ip6_tables.c:573
       translate_table+0xc8b/0x1750 net/ipv6/netfilter/ip6_tables.c:735
       do_replace net/ipv6/netfilter/ip6_tables.c:1153 [inline]
       do_ip6t_set_ctl+0x56e/0xb90 net/ipv6/netfilter/ip6_tables.c:1639
       nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101
      page last free stack trace:
       reset_page_owner include/linux/page_owner.h:24 [inline]
       free_pages_prepare mm/page_alloc.c:1352 [inline]
       free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404
       free_unref_page_prepare mm/page_alloc.c:3325 [inline]
       free_unref_page+0x19/0x690 mm/page_alloc.c:3404
       kvfree+0x42/0x50 mm/util.c:613
       rcu_do_batch kernel/rcu/tree.c:2527 [inline]
       rcu_core+0x7b1/0x1820 kernel/rcu/tree.c:2778
       __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
      
      Memory state around the buggy address:
       ffff88801c1a7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff88801c1a7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      >ffff88801c1a8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                         ^
       ffff88801c1a8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff88801c1a8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      
      Fixes: 2420b79f
      
       ("netfilter: debug: check for sorted array")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Acked-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      56763f12
    • Sasha Neftin's avatar
      igc: igc_write_phy_reg_gpy: drop premature return · c4208653
      Sasha Neftin authored
      Similar to "igc_read_phy_reg_gpy: drop premature return" patch.
      igc_write_phy_reg_gpy checks the return value from igc_write_phy_reg_mdic
      and if it's not 0, returns immediately. By doing this, it leaves the HW
      semaphore in the acquired state.
      
      Drop this premature return statement, the function returns after
      releasing the semaphore immediately anyway.
      
      Fixes: 5586838f
      
       ("igc: Add code for PHY support")
      Suggested-by: default avatarDima Ruinskiy <dima.ruinskiy@intel.com>
      Reported-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: default avatarSasha Neftin <sasha.neftin@intel.com>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c4208653
    • Corinna Vinschen's avatar
      igc: igc_read_phy_reg_gpy: drop premature return · fda26354
      Corinna Vinschen authored
      igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic
      and if it's not 0, returns immediately. By doing this, it leaves the HW
      semaphore in the acquired state.
      
      Drop this premature return statement, the function returns after
      releasing the semaphore immediately anyway.
      
      Fixes: 5586838f
      
       ("igc: Add code for PHY support")
      Signed-off-by: default avatarCorinna Vinschen <vinschen@redhat.com>
      Acked-by: default avatarSasha Neftin <sasha.neftin@intel.com>
      Tested-by: default avatarNaama Meir <naamax.meir@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      fda26354
    • Alex Elder's avatar
      net: ipa: fix a build dependency · caef14b7
      Alex Elder authored
      
      An IPA build problem arose in the linux-next tree the other day.
      The problem is that a recent commit adds a new dependency on some
      code, and the Kconfig file for IPA doesn't reflect that dependency.
      As a result, some configurations can fail to build (particularly
      when COMPILE_TEST is enabled).
      
      The recent patch adds calls to qmp_get(), qmp_put(), and qmp_send(),
      and those are built based on the QCOM_AOSS_QMP config option.  If
      that symbol is not defined, stubs are defined, so we just need to
      ensure QCOM_AOSS_QMP is compatible with QCOM_IPA, or it's not
      defined.
      
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Fixes: 34a08176
      
       ("net: ipa: request IPA register values be retained")
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      caef14b7
    • Jia-Ju Bai's avatar
      atm: firestream: check the return value of ioremap() in fs_init() · d4e26aae
      Jia-Ju Bai authored
      
      The function ioremap() in fs_init() can fail, so its return value should
      be checked.
      
      Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
      Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4e26aae
    • Casper Andersson's avatar
      net: sparx5: Add #include to remove warning · 90d40252
      Casper Andersson authored
      
      main.h uses NUM_TARGETS from main_regs.h, but
      the missing include never causes any errors
      because everywhere main.h is (currently)
      included, main_regs.h is included before.
      But since it is dependent on main_regs.h
      it should always be included.
      
      Signed-off-by: default avatarCasper Andersson <casper.casan@gmail.com>
      Reviewed-by: default avatarJoacim Zetterling <joacim.zetterling@westermo.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90d40252
    • Tony Lu's avatar
      net/smc: Fix cleanup when register ULP fails · 4d08b7b5
      Tony Lu authored
      This patch calls smc_ib_unregister_client() when tcp_register_ulp()
      fails, and make sure to clean it up.
      
      Fixes: d7cd421d
      
       ("net/smc: Introduce TCP ULP support")
      Signed-off-by: default avatarTony Lu <tonylu@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d08b7b5
    • j.nixdorf@avm.de's avatar
      net: ipv6: ensure we call ipv6_mc_down() at most once · 9995b408
      j.nixdorf@avm.de authored
      There are two reasons for addrconf_notify() to be called with NETDEV_DOWN:
      either the network device is actually going down, or IPv6 was disabled
      on the interface.
      
      If either of them stays down while the other is toggled, we repeatedly
      call the code for NETDEV_DOWN, including ipv6_mc_down(), while never
      calling the corresponding ipv6_mc_up() in between. This will cause a
      new entry in idev->mc_tomb to be allocated for each multicast group
      the interface is subscribed to, which in turn leaks one struct ifmcaddr6
      per nontrivial multicast group the interface is subscribed to.
      
      The following reproducer will leak at least $n objects:
      
      ip addr add ff2e::4242/32 dev eth0 autojoin
      sysctl -w net.ipv6.conf.eth0.disable_ipv6=1
      for i in $(seq 1 $n); do
      	ip link set up eth0; ip link set down eth0
      done
      
      Joining groups with IPV6_ADD_MEMBERSHIP (unprivileged) or setting the
      sysctl net.ipv6.conf.eth0.forwarding to 1 (=> subscribing to ff02::2)
      can also be used to create a nontrivial idev->mc_list, which will the
      leak objects with the right up-down-sequence.
      
      Based on both sources for NETDEV_DOWN events the interface IPv6 state
      should be considered:
      
       - not ready if the network interface is not ready OR IPv6 is disabled
         for it
       - ready if the network interface is ready AND IPv6 is enabled for it
      
      The functions ipv6_mc_up() and ipv6_down() should only be run when this
      state changes.
      
      Implement this by remembering when the IPv6 state is ready, and only
      run ipv6_mc_down() if it actually changed from ready to not ready.
      
      The other direction (not ready -> ready) already works correctly, as:
      
       - the interface notification triggered codepath for NETDEV_UP /
         NETDEV_CHANGE returns early if ipv6 is disabled, and
       - the disable_ipv6=0 triggered codepath skips fully initializing the
         interface as long as addrconf_link_ready(dev) returns false
       - calling ipv6_mc_up() repeatedly does not leak anything
      
      Fixes: 3ce62a84
      
       ("ipv6: exit early in addrconf_notify() if IPv6 is disabled")
      Signed-off-by: default avatarJohannes Nixdorf <j.nixdorf@avm.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9995b408
  5. Feb 26, 2022
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 519ca6fa
      David S. Miller authored
      
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-02-25
      
      This series contains updates to iavf driver only.
      
      Slawomir fixes stability issues that can be seen when stressing the
      driver using a large number of VFs with a multitude of operations.
      Among the fixes are reworking mutexes to provide more effective locking,
      ensuring initialization is complete before teardown, preventing
      operations which could race while removing the driver, stopping certain
      tasks from being queued when the device is down, and adding a missing
      mutex unlock.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      519ca6fa
  6. Feb 25, 2022