archive mirror
 help / color / mirror / Atom feed
From: Guillaume Nault <>
	Tom Parkin <>
Subject: Re: [BUG] net/ppp: A use after free in ppp_unregister_channe
Date: Mon, 15 Mar 2021 11:50:58 +0000	[thread overview]
Message-ID: <20210315115058.GA4296@linux.home> (raw)
In-Reply-To: <>

On Thu, Mar 11, 2021 at 08:34:44PM +0800, wrote:
> File: drivers/net/ppp/ppp_generic.c
> In ppp_unregister_channel, pch could be freed in ppp_unbridge_channels()
> but after that pch is still in use. Inside the function ppp_unbridge_channels,
> if "pchbb = pch" is true and then pch will be freed.

No. It's freed only if if the refcount drops to 0. And the caller of
ppp_unregister_channel() must hold its own refcount. So
ppp_unbridge_channels() is not going to drop the last refcount in this

> I checked the commit history and found that this problem is introduced from
> 4cf476ced45d7 ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls").

Next time, please also Cc. the author of the patch.

> I have no idea about how to generate a suitable patch, sorry.

There's no patch to send as far as I can see.

      parent reply	other threads:[~2021-03-15 11:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 12:34 [BUG] net/ppp: A use after free in ppp_unregister_channe lyl2019
2021-03-12 10:12 ` Tom Parkin
2021-03-12 14:47   ` lyl2019
2021-03-15  9:57     ` Tom Parkin
2021-03-15 12:18     ` Guillaume Nault
2021-03-15 16:58       ` Tom Parkin
2021-03-15 12:04   ` Guillaume Nault
2021-03-15 11:50 ` Guillaume Nault [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:

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

  git send-email \
    --in-reply-to=20210315115058.GA4296@linux.home \ \ \ \ \ \ \ \ \

* 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).