[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200228134048.19675-1-yangerkun@huawei.com>
Date: Fri, 28 Feb 2020 21:40:48 +0800
From: yangerkun <yangerkun@...wei.com>
To: <gregkh@...uxfoundation.org>
CC: <stable@...r.kernel.org>, <davem@...emloft.net>,
<netdev@...r.kernel.org>, <yangerkun@...wei.com>
Subject: [PATCH linux-4.4.y/linux-4.9.y v2] 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@...wei.com>
---
drivers/net/slip/slip.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 0f8d5609ed51..d4a33baa33b6 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();
--
2.23.0.rc2.8.gff66981f45
Powered by blists - more mailing lists