stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: yangerkun <yangerkun@huawei.com>
Cc: stable@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH linux-4.4.y/linux-4.9.y v2] slip: stop double free sl->dev in slip_open
Date: Tue, 3 Mar 2020 16:45:45 +0100	[thread overview]
Message-ID: <20200303154545.GC372992@kroah.com> (raw)
In-Reply-To: <20200228134048.19675-1-yangerkun@huawei.com>

On Fri, Feb 28, 2020 at 09:40:48PM +0800, yangerkun wrote:
> 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>
> ---
>  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);

Thanks for this, now queued up.

greg k-h

      reply	other threads:[~2020-03-03 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 13:40 [PATCH linux-4.4.y/linux-4.9.y v2] slip: stop double free sl->dev in slip_open yangerkun
2020-03-03 15:45 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200303154545.GC372992@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).