]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: correctly handle error in tun_set_iff()
authorJason Wang <jasowang@redhat.com>
Wed, 11 Sep 2013 10:09:48 +0000 (18:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Sep 2013 21:21:42 +0000 (17:21 -0400)
commit962ca7e4451d16d925b7c97fcaaf6335179ba665
treec8b6eccc605fe52837e21d72bdecbf8e0c71b539
parentb6d65704529b0846fbf19e30ac886a0abc2f6935
tuntap: correctly handle error in tun_set_iff()

Commit ad875707461d9d1409ce0203780868f6dde7245d
(tuntap: multiqueue support) only call free_netdev() on error in
tun_set_iff(). This causes several issues:

- memory of tun security were leaked
- use after free since the flow gc timer was not deleted and the tfile
  were not detached

This patch solves the above issues.

Reported-by: Wannes Rombouts <wannes.rombouts@epitech.eu>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c