netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Davide Caratti <dcaratti@redhat.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH net] net/sched: act_ife: initalize ife->metalist earlier
Date: Wed, 15 Jan 2020 07:56:35 -0800	[thread overview]
Message-ID: <CANn89iLi2eAHTMveBQviUOh5v3qdiw7xBZRsucAW4CemrAnzHw@mail.gmail.com> (raw)
In-Reply-To: <7b6aad5de9b62323f0a8b24ce2d5c7d5adcd89b4.camel@redhat.com>

On Wed, Jan 15, 2020 at 1:14 AM Davide Caratti <dcaratti@redhat.com> wrote:
>
> On Tue, 2020-01-14 at 13:51 -0800, Eric Dumazet wrote:
> > It seems better to init ife->metalist earlier in tcf_ife_init()
> > to avoid the following crash :
>
> hello Eric, and thanks for the patch.
>
> If I well understand the problem, we have
>
> _tcf_ife_cleanup()
>
> that does dereference of NULL ife->metalist,
> because it has not yet initialized by tcf_ife_init(). This happened
> probably because the control action was not valid (hence the Fixes:tag):
> so, tcf_ife_init() jumped to the error path before doing INIT_LIST_HEAD().
>
> I applied your patch to my tree, and I see this:
>
> net/sched/act_ife.c: In function 'tcf_ife_init':
> net/sched/act_ife.c:533:3: warning: 'ife' may be used uninitialized in
> this function [-Wmaybe-uninitialized]
>    INIT_LIST_HEAD(&ife->metalist);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> And I think the warning is telling us a real problem, because
>
>         ife = to_ife(*a);
>

Oops right, thanks for catching this. I am sending a V2.

      reply	other threads:[~2020-01-15 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 21:51 [PATCH net] net/sched: act_ife: initalize ife->metalist earlier Eric Dumazet
2020-01-15  9:14 ` Davide Caratti
2020-01-15 15:56   ` Eric Dumazet [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=CANn89iLi2eAHTMveBQviUOh5v3qdiw7xBZRsucAW4CemrAnzHw@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzkaller@googlegroups.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).