]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
atm: clip: Fix potential null-ptr-deref in to_atmarpd().
authorKuniyuki Iwashima <kuniyu@google.com>
Fri, 4 Jul 2025 06:23:51 +0000 (06:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:35:10 +0000 (18:35 +0200)
commit06935c50cfa3ac57cce80bba67b6d38ec1406e92
treefe281fe54cea35262993708b057bd72ed5719f9b
parent36cf9bcf09bd2a86b26ca5fb3c7d0655bf3ffb11
atm: clip: Fix potential null-ptr-deref in to_atmarpd().

[ Upstream commit 706cc36477139c1616a9b2b96610a8bb520b7119 ]

atmarpd is protected by RTNL since commit f3a0592b37b8 ("[ATM]: clip
causes unregister hang").

However, it is not enough because to_atmarpd() is called without RTNL,
especially clip_neigh_solicit() / neigh_ops->solicit() is unsleepable.

Also, there is no RTNL dependency around atmarpd.

Let's use a private mutex and RCU to protect access to atmarpd in
to_atmarpd().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250704062416.1613927-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/atm/clip.c