af_packet: block BH in prb_shutdown_retire_blk_timer()
authorVeaceslav Falico <vfalico@redhat.com>
Fri, 29 Nov 2013 08:53:23 +0000 (09:53 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 3 Jan 2014 04:33:34 +0000 (04:33 +0000)
commit05340764e797226e1d9e91a76a0489ed72b3c355
treefe6d5d1607b454afc02ee2768bc3406f0d7ea4c2
parentea15a900813efe07bf1cb210fa6388659b264e33
af_packet: block BH in prb_shutdown_retire_blk_timer()

[ Upstream commit ec6f809ff6f19fafba3212f6aff0dda71dfac8e8 ]

Currently we're using plain spin_lock() in prb_shutdown_retire_blk_timer(),
however the timer might fire right in the middle and thus try to re-aquire
the same spinlock, leaving us in a endless loop.

To fix that, use the spin_lock_bh() to block it.

Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.")
CC: "David S. Miller" <davem@davemloft.net>
CC: Daniel Borkmann <dborkman@redhat.com>
CC: Willem de Bruijn <willemb@google.com>
CC: Phil Sutter <phil@nwl.cc>
CC: Eric Dumazet <edumazet@google.com>
Reported-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/packet/af_packet.c