]> git.baikalelectronics.ru Git - kernel.git/commit
tun: make tun_build_skb() thread safe
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 16 Aug 2017 14:14:33 +0000 (22:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 21:27:35 +0000 (14:27 -0700)
commit1cc706a5723be78f8594af9101f756ac7b4fc87d
treefea2d275e5a381ec4d90bbcf13f5a3840127e344
parent1fd9a4cad0a3150a8bed70f62fc7861e05978afe
tun: make tun_build_skb() thread safe

tun_build_skb() is not thread safe since it uses per queue page frag,
this will break things when multiple threads are sending through same
queue. Switch to use per-thread generator (no lock involved).

Fixes: 0156fb8195cb ("tap: use build_skb() for small packet")
Tested-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c