All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	stable@kernel.org
Subject: Re: [PATCH v2 1/1] net/sched: cls_u32: Fix reference counter leak leading to overflow
Date: Thu, 8 Jun 2023 08:47:01 +0100	[thread overview]
Message-ID: <20230608074701.GD1930705@google.com> (raw)
In-Reply-To: <CANn89iKtkzTKhmeK15BO4uZOBQJhQWgQkaUgT+cxo+BwxE6Ofw@mail.gmail.com>

On Thu, 08 Jun 2023, Eric Dumazet wrote:

> On Thu, Jun 8, 2023 at 9:29 AM Lee Jones <lee@kernel.org> wrote:
> >
> > In the event of a failure in tcf_change_indev(), u32_set_parms() will
> > immediately return without decrementing the recently incremented
> > reference counter.  If this happens enough times, the counter will
> > rollover and the reference freed, leading to a double free which can be
> > used to do 'bad things'.
> >
> > In order to prevent this, move the point of possible failure above the
> > point where the reference counter is incremented.  Also save any
> > meaningful return values to be applied to the return data at the
> > appropriate point in time.
> >
> > This issue was caught with KASAN.
> >
> > Fixes: 705c7091262d ("net: sched: cls_u32: no need to call tcf_exts_change for newly allocated struct")
> > Suggested-by: Eric Dumazet <edumazet@google.com>
> > Signed-off-by: Lee Jones <lee@kernel.org>
> > ---
> 
> Thanks Lee !

No problem.  Thanks for your help.

> Reviewed-by: Eric Dumazet <edumazet@google.com>

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2023-06-08  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  7:29 [PATCH v2 1/1] net/sched: cls_u32: Fix reference counter leak leading to overflow Lee Jones
2023-06-08  7:31 ` Eric Dumazet
2023-06-08  7:47   ` Lee Jones [this message]
2023-06-08 16:40     ` Jamal Hadi Salim
2023-06-08 17:58       ` Lee Jones
2023-06-09 10:50 ` patchwork-bot+netdevbpf

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=20230608074701.GD1930705@google.com \
    --to=lee@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@kernel.org \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.