]> git.baikalelectronics.ru Git - kernel.git/commit
net/packet: convert po->origdev to an atomic flag
authorEric Dumazet <edumazet@google.com>
Thu, 16 Mar 2023 01:10:07 +0000 (01:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:18 +0000 (23:03 +0900)
commit0e819c7d5e18cc6fbf7413785abfc3aad19ee98a
treedf7169e333514b21347911e0e9b8e48178201726
parenta3b1a8e4a17f93669b1fb971ab9eb425ac277e5b
net/packet: convert po->origdev to an atomic flag

[ Upstream commit ee5675ecdf7a4e713ed21d98a70c2871d6ebed01 ]

syzbot/KCAN reported that po->origdev can be read
while another thread is changing its value.

We can avoid this splat by converting this field
to an actual bit.

Following patches will convert remaining 1bit fields.

Fixes: 3dc15cc8ffbb ("[AF_PACKET]: Add option to return orig_dev to userspace.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/packet/af_packet.c
net/packet/diag.c
net/packet/internal.h