summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authoryangerkun <yangerkun@huawei.com>2020-02-28 21:40:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-11 07:53:07 +0100
commite7fe43afa869bc5931d046707b872fdc19946bf3 (patch)
treefb007316919be5238434263a15e05211378c327c /drivers
parent24d85373578acb9566852a0e094ff33e71b5a924 (diff)
slip: stop double free sl->dev in slip_open
After include 3b5a39979daf ("slip: Fix memory leak in slip_open error path") and e58c19124189 ("slip: Fix use-after-free Read in slip_open") with 4.4.y/4.9.y. We will trigger a bug since we can double free sl->dev in slip_open. Actually, we should backport cf124db566e6 ("net: Fix inconsistent teardown and release of private netdev state.") too since it has delete free_netdev from sl_free_netdev. Fix it by delete free_netdev from slip_open. Signed-off-by: yangerkun <yangerkun@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/slip/slip.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 2af09c3851a5..cc841126147e 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -868,7 +868,6 @@ err_free_chan:
tty->disc_data = NULL;
clear_bit(SLF_INUSE, &sl->flags);
sl_free_netdev(sl->dev);
- free_netdev(sl->dev);
err_exit:
rtnl_unlock();