]> git.baikalelectronics.ru Git - kernel.git/commit
packet: dont call sleeping functions while holding rcu_read_lock()
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 15 Dec 2009 05:47:03 +0000 (05:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Dec 2009 05:12:21 +0000 (21:12 -0800)
commit4aabc539b16dc6ee10695408e3475b1761ba1084
tree3ff2f23730c2bc6ea8af20232d02dad65ae63f0a
parentcd78de9d9c39e9b2cd1bf99b67075c8b7a509dd3
packet: dont call sleeping functions while holding rcu_read_lock()

commit 580334554fb26adf1 (packet: less dev_put() calls)
introduced a problem, calling potentially sleeping functions from a
rcu_read_lock() protected section.

Fix this by releasing lock before the sock_wmalloc()/memcpy_fromiovec() calls.

After skb allocation and copy from user space, we redo device
lookup and appropriate tests.

Reported-and-tested-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c