]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Wed, 17 May 2023 09:11:41 +0000 (11:11 +0200)
commit1baa8c1be38c43368868b9ef764f8ab2356ffe02
treefc099a2bacb325c9ece2dc77266b80dbfe87e4ce
parent5ea05bf6edbd00cc8914b2f8038d06825b9a7202
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: 80feaacb8a64 ("[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