]> 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>
Wed, 17 May 2023 09:35:41 +0000 (11:35 +0200)
commitea3f277ff04172038e8d525a03fac3cf58114844
tree83d8e40a44f2f8bfb89415a65ba812af1ef9fd56
parentfa9fd8b34c052f357871a67e451df6cadd01c3d5
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