netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Parkin <tparkin@katalix.com>
To: Guillaume Nault <gnault@redhat.com>
Cc: netdev@vger.kernel.org, jchapman@katalix.com
Subject: Re: [PATCH net v3] ppp: fix refcount underflow on channel unbridge
Date: Mon, 11 Jan 2021 10:28:58 +0000	[thread overview]
Message-ID: <20210111102858.GA6062@katalix.com> (raw)
In-Reply-To: <20210108205750.GA14215@linux.home>

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

On  Fri, Jan 08, 2021 at 21:57:50 +0100, Guillaume Nault wrote:
> On Thu, Jan 07, 2021 at 06:13:15PM +0000, Tom Parkin wrote:
> > When setting up a channel bridge, ppp_bridge_channels sets the
> > pch->bridge field before taking the associated reference on the bridge
> > file instance.
> > 
> > This opens up a refcount underflow bug if ppp_bridge_channels called
> > via. iotcl runs concurrently with ppp_unbridge_channels executing via.
> > file release.
> > 
> > The bug is triggered by ppp_bridge_channels taking the error path
> > through the 'err_unset' label.  In this scenario, pch->bridge is set,
> > but the reference on the bridged channel will not be taken because
> > the function errors out.  If ppp_unbridge_channels observes pch->bridge
> > before it is unset by the error path, it will erroneously drop the
> > reference on the bridged channel and cause a refcount underflow.
> > 
> > To avoid this, ensure that ppp_bridge_channels holds a reference on
> > each channel in advance of setting the bridge pointers.
> 
> Thanks for following up on this!
> 
> Acked-by: Guillaume Nault <gnault@redhat.com>

Thanks again for reviewing, Guillaume.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2021-01-11 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 18:13 [PATCH net v3] ppp: fix refcount underflow on channel unbridge Tom Parkin
2021-01-08 20:57 ` Guillaume Nault
2021-01-09  3:23   ` Jakub Kicinski
2021-01-11 10:28   ` Tom Parkin [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=20210111102858.GA6062@katalix.com \
    --to=tparkin@katalix.com \
    --cc=gnault@redhat.com \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    /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).