Various BPF helper improvements#122
Conversation
|
Master branch: ba5f4cf Pull request is NOT updated. Failed to apply https://patchwork.ozlabs.org/project/netdev/list/?series=204609, error message: |
|
Master branch: ba5f4cf |
82df0f6 to
61c377d
Compare
|
Master branch: 1fd17c8 |
61c377d to
87e9a2b
Compare
|
Master branch: 09d8ad1 |
87e9a2b to
7341c24
Compare
|
Master branch: efa90b5 |
7341c24 to
7e5125f
Compare
|
Master branch: 84a20d8 |
7e5125f to
a04c767
Compare
|
Master branch: b000def |
a04c767 to
074efc3
Compare
Similarly to 5a52ae4 ("bpf: Allow to retrieve cgroup v1 classid from v2 hooks"), add a helper to retrieve cgroup v1 classid solely based on the skb->sk, so it can be used as key as part of BPF map lookups out of tc from host ns, in particular given the skb->sk is retained these days when crossing net ns thanks to 9c4c325 ("skbuff: preserve sock reference when scrubbing the skb."). This is similar to bpf_skb_cgroup_id() which implements the same for v2. Kubernetes ecosystem is still operating on v1 however, hence net_cls needs to be used there until this can be dropped in with the v2 helper of bpf_skb_cgroup_id(). Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
With its use in BPF, the cookie generator can be called very frequently in particular when used out of cgroup v2 hooks (e.g. connect / sendmsg) and attached to the root cgroup, for example, when used in v1/v2 mixed environments. In particular, when there's a high churn on sockets in the system there can be many parallel requests to the bpf_get_socket_cookie() and bpf_get_netns_cookie() helpers which then cause contention on the atomic counter. As similarly done in f991bd2 ("fs: introduce a per-cpu last_ino allocator"), add a small helper library that both can use for the 64 bit counters. Given this can be called from different contexts, we also need to deal with potential nested calls even though in practice they are considered extremely rare. One idea as suggested by Eric Dumazet was to use a reverse counter for this stiuation since we don't expect 64 bit overflows anyways; that way, we can avoid bigger gaps in the 64 bit counter space compared to just batch-wise increase. Even on machines with small number of cores (e.g. 4) the cookie generation shrinks from min/max/med/avg (ns) of 22/50/40/38.9 down to 10/35/14/17.3 when run in parallel from multiple CPUs. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Eric Dumazet <eric.dumazet@gmail.com>
Add a redirect_neigh() helper as redirect() drop-in replacement for the xmit side. Main idea for the helper is to be very similar in semantics to the latter just that the skb gets injected into the neighboring subsystem in order to let the stack do the work it knows best anyway to populate the L2 addresses of the packet and then hand over to dev_queue_xmit() as redirect() does. This solves two bigger items: i) skbs don't need to go up to the stack on the host facing veth ingress side for traffic egressing the container to achieve the same for populating L2 which also has the huge advantage that ii) the skb->sk won't get orphaned in ip_rcv_core() when entering the IP routing layer on the host stack. Given that skb->sk neither gets orphaned when crossing the netns as per 9c4c325 ("skbuff: preserve sock reference when scrubbing the skb.") the helper can then push the skbs directly to the phys device where FQ scheduler can do its work and TCP stack gets proper backpressure given we hold on to skb->sk as long as skb is still residing in queues. With the helper used in BPF data path to then push the skb to the phys device, I observed a stable/consistent TCP_STREAM improvement on veth devices for traffic going container -> host -> host -> container from ~10Gbps to ~15Gbps for a single stream in my test environment. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: David Ahern <dsahern@kernel.org>
Port of tail_call_static() helper function from Cilium's BPF code base [0] to libbpf, so others can easily consume it as well. We've been using this in production code for some time now. The main idea is that we guarantee that the kernel's BPF infrastructure and JIT (here: x86_64) can patch the JITed BPF insns with direct jumps instead of having to fall back to using expensive retpolines. By using inline asm, we guarantee that the compiler won't merge the call from different paths with potentially different content of r2/r3. We're also using Cilium's __throw_build_bug() macro (here as: __bpf_unreachable()) in different places as a neat trick to trigger compilation errors when compiler does not remove code at compilation time. This works for the BPF back end as it does not implement the __builtin_trap(). [0] cilium/cilium@f5537c2 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Andrii Nakryiko <andriin@fb.com> Acked-by: Andrii Nakryiko <andriin@fb.com>
For those locations where we use an immediate tail call map index use the newly added bpf_tail_call_static() helper. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Add a small test that excercises the new redirect_neigh() helper for the IPv4 and IPv6 case. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
|
Master branch: a871b04 |
074efc3 to
9466981
Compare
|
Master branch: 98b972d Pull request is NOT updated. Failed to apply https://patchwork.ozlabs.org/project/netdev/list/?series=204609 conflict: |
|
At least one diff in series https://patchwork.ozlabs.org/project/netdev/list/?series=204609 expired. Closing PR. |
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: NipaLocal <nipa@local>
Access to net_device::ip_ptr and its associated members must be protected by an RCU lock. Since we are modifying this piece of code, let's also move it to execute only when WAKE_ARP is enabled. To minimize the duration of the RCU lock, a local variable is used to temporarily store the IP address. This change resolves the following RCU check warning: WARNING: suspicious RCU usage 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 Not tainted ----------------------------- drivers/net/ethernet/cadence/macb_main.c:5944 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 5 locks held by rtcwake/518: #0: ffff000803ab1408 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0xf8/0x368 kernel-patches#1: ffff0008090bf088 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0xbc/0x1c8 kernel-patches#2: ffff00080098d588 (kn->active#70){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xcc/0x1c8 kernel-patches#3: ffff800081c84888 (system_transition_mutex){+.+.}-{4:4}, at: pm_suspend+0x1ec/0x290 kernel-patches#4: ffff0008009ba0f8 (&dev->mutex){....}-{4:4}, at: device_suspend+0x118/0x4f0 stack backtrace: CPU: 3 UID: 0 PID: 518 Comm: rtcwake Not tainted 7.0.0-rc3-next-20260310-yocto-standard+ kernel-patches#122 PREEMPT Hardware name: ZynqMP ZCU102 Rev1.1 (DT) Call trace: show_stack+0x24/0x38 (C) __dump_stack+0x28/0x38 dump_stack_lvl+0x64/0x88 dump_stack+0x18/0x24 lockdep_rcu_suspicious+0x134/0x1d8 macb_suspend+0xd8/0x4c0 device_suspend+0x218/0x4f0 dpm_suspend+0x244/0x3a0 dpm_suspend_start+0x50/0x78 suspend_devices_and_enter+0xec/0x560 pm_suspend+0x194/0x290 state_store+0x110/0x158 kobj_attr_store+0x1c/0x30 sysfs_kf_write+0xa8/0xd0 kernfs_fop_write_iter+0x11c/0x1c8 vfs_write+0x248/0x368 ksys_write+0x7c/0xf8 __arm64_sys_write+0x28/0x40 invoke_syscall+0x4c/0xe8 el0_svc_common+0x98/0xf0 do_el0_svc+0x28/0x40 el0_svc+0x54/0x1e0 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 Fixes: 0cb8de3 ("net: macb: Add ARP support to WOL") Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20260318-macb-irq-v2-2-f1179768ab24@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
hw_ops->init() can fail, thus leaving uninitialized TX and RX descriptor objects. Later when they are updated in xlgmac_dev_xmit(), there is a NULL pointer dereference. general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [kernel-patches#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 6.1.164+ kernel-patches#122 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 Workqueue: mld mld_ifc_work RIP: 0010:xlgmac_dev_xmit+0x62f/0x1260 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:827 Call Trace: <TASK> xlgmac_xmit+0xa14/0x1196 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c:766 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3683 [inline] dev_hard_start_xmit+0x126/0x680 net/core/dev.c:3699 sch_direct_xmit+0x18a/0x7e0 net/sched/sch_generic.c:345 __dev_xmit_skb net/core/dev.c:3920 [inline] __dev_queue_xmit+0x19ef/0x3da0 net/core/dev.c:4325 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_resolve_output net/core/neighbour.c:1568 [inline] neigh_resolve_output+0x563/0x880 net/core/neighbour.c:1548 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xb4f/0x2390 net/ipv6/ip6_output.c:138 __ip6_finish_output+0x48c/0x1300 net/ipv6/ip6_output.c:205 ip6_finish_output net/ipv6/ip6_output.c:216 [inline] NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x250/0x910 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] NF_HOOK.constprop.0+0x111/0x8a0 include/linux/netfilter.h:302 mld_sendpack+0x67b/0xd40 net/ipv6/mcast.c:1825 mld_send_cr net/ipv6/mcast.c:2126 [inline] mld_ifc_work+0x7a5/0xd80 net/ipv6/mcast.c:2656 process_one_work+0x97f/0x1470 kernel/workqueue.c:2292 worker_thread+0x5a1/0x1090 kernel/workqueue.c:2439 kthread+0x2e1/0x3a0 kernel/kthread.c:376 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 65e0ace ("net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet") Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: NipaLocal <nipa@local>
Pull request for series with
subject: Various BPF helper improvements
version: 2
url: https://patchwork.ozlabs.org/project/netdev/list/?series=204609