Skip to content
Commit 905db440 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

packet: Avoid lock_sock in mmap handler



As the mmap handler gets called under mmap_sem, and we may grab
mmap_sem elsewhere under the socket lock to access user data, we
should avoid grabbing the socket lock in the mmap handler.

Since the only thing we care about in the mmap handler is for
pg_vec* to be invariant, i.e., to exclude packet_set_ring, we
can achieve this by simply using a new mutex.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Tested-by: default avatarMartin MOKREJŠ <mmokrejs@ribosome.natur.cuni.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1974cc20
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment