]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: convert nlk->flags to atomic flags
authorEric Dumazet <edumazet@google.com>
Fri, 11 Aug 2023 07:22:26 +0000 (07:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:02 +0000 (11:11 +0200)
commitc2b226f223fb4c4e06273592e41d2a8d15f814d9
tree1deb44efb2f2a5f034344c7703f01a497772db2c
parent06e2b5ad72b60f90bfe565c201346532e271f484
netlink: convert nlk->flags to atomic flags

[ Upstream commit 8fe08d70a2b61b35a0a1235c78cf321e7528351f ]

sk_diag_put_flags(), netlink_setsockopt(), netlink_getsockopt()
and others use nlk->flags without correct locking.

Use set_bit(), clear_bit(), test_bit(), assign_bit() to remove
data-races.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netlink/af_netlink.c
net/netlink/af_netlink.h
net/netlink/diag.c