• David Woodhouse's avatar
    tun: add IFF_TUN_EXCL flag to avoid opening a persistent device. · f85ba780
    David Woodhouse authored
    When creating a certain types of VPN, NetworkManager will first attempt
    to find an available tun device by iterating through 'vpn%d' until it
    finds one that isn't already busy. Then it'll set that to be persistent
    and owned by the otherwise unprivileged user that the VPN dæmon itself
    runs as.
    
    There's a race condition here -- during the period where the vpn%d
    device is created and we're waiting for the VPN dæmon to actually
    connect and use it, if we try to create _another_ device we could end up
    re-using the same one -- because trying to open it again doesn't get
    -EBUSY as it would while it's _actually_ busy.
    
    So solve this, we add an IFF_TUN_EXCL flag which causes tun_set_iff() to
    fail if it would be opening an existing persistent tundevice -- so that
    we can make sure we're getting an entirely _new_ device.
    Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f85ba780
Name
Last commit
Last update
..
accessibility Loading commit data...
acpi Loading commit data...
amba Loading commit data...
ata Loading commit data...
atm Loading commit data...
auxdisplay Loading commit data...
base Loading commit data...
block Loading commit data...
bluetooth Loading commit data...
cdrom Loading commit data...
char Loading commit data...
clocksource Loading commit data...
connector Loading commit data...
cpufreq Loading commit data...
cpuidle Loading commit data...
crypto Loading commit data...
dca Loading commit data...
dio Loading commit data...
dma Loading commit data...
edac Loading commit data...
eisa Loading commit data...
firewire Loading commit data...
firmware Loading commit data...
gpio Loading commit data...
gpu Loading commit data...
hid Loading commit data...
hwmon Loading commit data...
i2c Loading commit data...
ide Loading commit data...
idle Loading commit data...
ieee1394 Loading commit data...
infiniband Loading commit data...
input Loading commit data...
isdn Loading commit data...
leds Loading commit data...
lguest Loading commit data...
macintosh Loading commit data...
mca Loading commit data...
md Loading commit data...
media Loading commit data...
memstick Loading commit data...
message Loading commit data...
mfd Loading commit data...
misc Loading commit data...
mmc Loading commit data...
mtd Loading commit data...
net Loading commit data...
nubus Loading commit data...
of Loading commit data...
oprofile Loading commit data...
parisc Loading commit data...
parport Loading commit data...
pci Loading commit data...
pcmcia Loading commit data...
platform Loading commit data...
pnp Loading commit data...
power Loading commit data...
ps3 Loading commit data...
rapidio Loading commit data...
regulator Loading commit data...
rtc Loading commit data...
s390 Loading commit data...
sbus Loading commit data...
scsi Loading commit data...
serial Loading commit data...
sh Loading commit data...
sn Loading commit data...
spi Loading commit data...
ssb Loading commit data...
staging Loading commit data...
tc Loading commit data...
telephony Loading commit data...
thermal Loading commit data...
uio Loading commit data...
usb Loading commit data...
uwb Loading commit data...
video Loading commit data...
virtio Loading commit data...
w1 Loading commit data...
watchdog Loading commit data...
xen Loading commit data...
zorro Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...