]> git.baikalelectronics.ru Git - kernel.git/commit
tun/tap: Fix crashes if open() /dev/net/tun and then poll() it.
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Sun, 5 Jul 2009 19:48:35 +0000 (19:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2009 19:47:07 +0000 (12:47 -0700)
commitb3658c169a39295dd0aa1585e34b4e2a712bf376
tree7c60ab7e391f73ffcbcb98613ee454f843d7b3d1
parent1e6537e955937b990100e744416afa099c09f554
tun/tap: Fix crashes if open() /dev/net/tun and then poll() it.

Fix NULL pointer dereference in tun_chr_pool() introduced by commit
d3c898f70e4e25583a382b8a324f3f5cfbfd61c9 ("tun: Limit amount of queued
packets per device") and triggered by this code:

int fd;
struct pollfd pfd;
fd = open("/dev/net/tun", O_RDWR);
pfd.fd = fd;
pfd.events = POLLIN | POLLOUT;
poll(&pfd, 1, 0);

Reported-by: Eugene Kapun <abacabadabacaba@gmail.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c