]>
Commit | Line | Data |
---|---|---|
41bc7a23 GKH |
1 | From 9180bb4f046064dfa4541488102703b402bb04e1 Mon Sep 17 00:00:00 2001 |
2 | From: Eric Dumazet <edumazet@google.com> | |
3 | Date: Sat, 16 Mar 2019 13:09:53 -0700 | |
4 | Subject: tun: add a missing rcu_read_unlock() in error path | |
5 | ||
6 | From: Eric Dumazet <edumazet@google.com> | |
7 | ||
8 | commit 9180bb4f046064dfa4541488102703b402bb04e1 upstream. | |
9 | ||
10 | In my latest patch I missed one rcu_read_unlock(), in case | |
11 | device is down. | |
12 | ||
13 | Fixes: 4477138fa0ae ("tun: properly test for IFF_UP") | |
14 | Signed-off-by: Eric Dumazet <edumazet@google.com> | |
15 | Reported-by: syzbot <syzkaller@googlegroups.com> | |
16 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/net/tun.c | 1 + | |
21 | 1 file changed, 1 insertion(+) | |
22 | ||
23 | --- a/drivers/net/tun.c | |
24 | +++ b/drivers/net/tun.c | |
25 | @@ -1960,6 +1960,7 @@ drop: | |
26 | rcu_read_lock(); | |
27 | if (unlikely(!(tun->dev->flags & IFF_UP))) { | |
28 | err = -EIO; | |
29 | + rcu_read_unlock(); | |
30 | goto drop; | |
31 | } | |
32 |