]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
packet: fix tp_reserve race in packet_set_ring
authorWillem de Bruijn <willemb@google.com>
Thu, 10 Aug 2017 16:41:58 +0000 (12:41 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 11 Aug 2017 09:37:48 +0000 (11:37 +0200)
commitad629e8e01adae9bf9a615b9d8dad5aa52b9e17a
tree254e892edfc7dacfa85e87d426139bc944e73284
parent6bb37937a52658509b58a3f0349806508ae34a70
packet: fix tp_reserve race in packet_set_ring

Updates to tp_reserve can race with reads of the field in
packet_set_ring. Avoid this by holding the socket lock during
updates in setsockopt PACKET_RESERVE.

This bug was discovered by syzkaller.

Fixes: 8913336a7e8d ("packet: add PACKET_RESERVE sockopt")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
CVE-2017-1000111

(cherry-picked from commit c27927e372f0785f3303e8fad94b85945e2c97b7)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/packet/af_packet.c