tap: double-free in error path in tap_open()
authorGirish Moodalbail <girish.moodalbail@oracle.com>
Wed, 25 Oct 2017 07:23:04 +0000 (00:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:30:37 +0000 (11:30 +0100)
commit3b7e3bdf361e1f21c02ba95ba1755079b23a0f09
tree83f4cf3bae61984f6696900dfe16e41d03fce520
parent6d71d310fc798dd6dc605b241ec69afff691db13
tap: double-free in error path in tap_open()

[ Upstream commit 78e0ea6791d7baafb8a0ca82b1bd0c7b3453c919 ]

Double free of skb_array in tap module is causing kernel panic. When
tap_set_queue() fails we free skb_array right away by calling
skb_array_cleanup(). However, later on skb_array_cleanup() is called
again by tap_sock_destruct through sock_put(). This patch fixes that
issue.

Fixes: 362899b8725b35e3 (macvtap: switch to use skb array)
Signed-off-by: Girish Moodalbail <girish.moodalbail@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/tap.c