diff options
| author | Yousef Alhouseen <alhouseenyousef@gmail.com> | 2026-06-28 02:28:04 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-06-29 18:47:23 -0700 |
| commit | 2e996ca81f9512c2d39d826a5146e5fe4ab28277 (patch) | |
| tree | 67a5a43842ec7c95dc60514665e5b5b6a725d44a /rust/zerocopy/git@git.tavy.me:linux-stable.git | |
| parent | 9facb861dc6b9b9ea9793ef5032a9a826f7a4229 (diff) | |
netdevsim: remove ethtool debugfs files before freeing netdev
The ethtool debugfs files point directly into struct netdevsim, which is
allocated as net_device private data. Their containing port directory is
removed only after nsim_destroy() calls free_netdev().
An open simple-attribute file can consequently dereference the freed
private data before the directory is removed. KASAN observed this in
debugfs_u32_get() during network namespace teardown.
Track and remove the ethtool subtree before free_netdev() on both the
normal and registration-failure paths. debugfs removal drains active
file users before returning.
Fixes: ff1f7c17fb20 ("netdevsim: add pause frame stats")
Reported-by: syzbot+6c25f4750230faf70be9@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6c25f4750230faf70be9
Cc: <stable+noautosel@kernel.org> # netdevsim is a test harness, it's never loaded on production systems
Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
Link: https://patch.msgid.link/20260628002804.24214-1-alhouseenyousef@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/zerocopy/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
