Re: [PATCH net] tun: fix rcu_read_lock imbalance in tun_build_skb

2017-11-19 Thread David Miller
From: Xin Long Date: Sun, 19 Nov 2017 19:31:04 +0800 > rcu_read_lock in tun_build_skb is used to rcu_dereference tun->xdp_prog > safely, rcu_read_unlock should be done in every return path. > > Now I could see one place missing it, where it returns NULL in switch-case > XDP_REDIRECT, another pa

[PATCH net] tun: fix rcu_read_lock imbalance in tun_build_skb

2017-11-19 Thread Xin Long
rcu_read_lock in tun_build_skb is used to rcu_dereference tun->xdp_prog safely, rcu_read_unlock should be done in every return path. Now I could see one place missing it, where it returns NULL in switch-case XDP_REDIRECT, another palce using rcu_read_lock wrongly, where it returns NULL in if (xdp