]> git.ipfire.org Git - thirdparty/linux.git/commit
phonet: Don't hold RTNL for getaddr_dumpit().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Thu, 17 Oct 2024 18:31:36 +0000 (11:31 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 24 Oct 2024 14:03:40 +0000 (16:03 +0200)
commitb7d2fc9ad7fe75b536f94409b7f1e90e12e4f44d
tree2156065326437598def2b8592e8cbf281f87224c
parent8786e98dd0ebb8ab3adfddd3517f3505c3a61c23
phonet: Don't hold RTNL for getaddr_dumpit().

getaddr_dumpit() already relies on RCU and does not need RTNL.

Let's use READ_ONCE() for ifindex and register getaddr_dumpit()
with RTNL_FLAG_DUMP_UNLOCKED.

While at it, the retval of getaddr_dumpit() is changed to combine
NLMSG_DONE and save recvmsg() as done in 58a4ff5d77b1 ("phonet: no
longer hold RTNL in route_dumpit()").

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/phonet/pn_netlink.c