]> git.baikalelectronics.ru Git - kernel.git/commit
tun: use socket locks for sk_{attach,detatch}_filter
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Tue, 5 Apr 2016 15:10:16 +0000 (17:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Apr 2016 20:44:14 +0000 (16:44 -0400)
commita7733c7c3f865cae0aab1e3de5cec106401b5fb5
tree24f93b5ab435e0bd4cada95b9f91df0a2e205186
parentc3b942c1a2d9a518b227621f1104c7b1a20fd881
tun: use socket locks for sk_{attach,detatch}_filter

This reverts commit 2b92cf355119a59 ("tun, bpf: fix suspicious RCU usage
in tun_{attach, detach}_filter") and replaces it to use lock_sock around
sk_{attach,detach}_filter. The checks inside filter.c are updated with
lockdep_sock_is_held to check for proper socket locks.

It keeps the code cleaner by ensuring that only one lock governs the
socket filter instead of two independent locks.

Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c
include/linux/filter.h
net/core/filter.c