projects
/
profile
/
ivi
/
kernel-adaptation-intel-automotive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tuntap: refuse to re-attach to different tun_struct
[profile/ivi/kernel-adaptation-intel-automotive.git]
/
drivers
/
net
/
tun.c
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index
fbd106e
..
cf6da6e
100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-491,6
+491,8
@@
static int tun_attach(struct tun_struct *tun, struct file *file)
err = -EINVAL;
if (rcu_dereference_protected(tfile->tun, lockdep_rtnl_is_held()))
goto out;
+ if (tfile->detached && tun != tfile->detached)
+ goto out;
err = -EBUSY;
if (!(tun->flags & TUN_TAP_MQ) && tun->numqueues == 1)