diff options
| author | Jakub Kicinski <[email protected]> | 2024-11-19 02:59:34 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-11-19 03:01:47 +0000 |
| commit | 21742be898fb6d99d4d85e293bd501b6870b503a (patch) | |
| tree | 8689e499621e0d7e495ef6ee3edb36dba7de1726 /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | |
| parent | MAINTAINERS: exclude can core, drivers and DT bindings from netdev ML (diff) | |
| parent | netpoll: Use rcu_access_pointer() in netpoll_poll_lock (diff) | |
| download | kernel-21742be898fb6d99d4d85e293bd501b6870b503a.tar.gz kernel-21742be898fb6d99d4d85e293bd501b6870b503a.zip | |
Merge branch 'netpoll-use-rcu-primitives-for-npinfo-pointer-access'
Breno Leitao says:
====================
netpoll: Use RCU primitives for npinfo pointer access
The net_device->npinfo pointer is marked with __rcu, indicating it requires
proper RCU access primitives:
struct net_device {
...
struct netpoll_info __rcu *npinfo;
...
};
Direct access to this pointer can lead to issues such as:
- Compiler incorrectly caching/reusing stale pointer values
- Missing memory ordering guarantees
- Non-atomic pointer loads
Replace direct NULL checks of npinfo with rcu_access_pointer(),
which provides the necessary memory ordering guarantees without the
overhead of a full RCU dereference, since we only need to verify
if the pointer is NULL.
In both cases, the RCU read lock is not held when the function is being
called. I checked that by using lockdep_assert_in_rcu_read_lock(), and
seeing the warning on both cases.
====================
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions
