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

  On Wed, 2020-01-15 at 07:58 -0800, Eric Dumazet wrote:
> It seems better to init ife->metalist earlier in tcf_ife_init()
> to avoid the following crash :

hi Eric, thanks for following up!

[...]
> ---
> v2: addressed Davide feedback.
>  net/sched/act_ife.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
> index 5e6379028fc392031f4b84599f666a2c61f071d2..ab748701374f65028c79cb789d065305430ea4c5 100644
> --- a/net/sched/act_ife.c
> +++ b/net/sched/act_ife.c
> @@ -537,6 +537,9 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
>  	}
>  
>  	ife = to_ife(*a);
> +	if (ret = ACT_P_CREATED)
> +		INIT_LIST_HEAD(&ife->metalist);
> +

I didn't test the hunk above, but I think there is a typo, this assigns
'ret' rather than checking if it's equal to ACT_P_CREATED.

It should be something like:

	if (ret == ACT_P_CREATED)
		INIT_LIST_HEAD(&ife->metalist);
 
correct?

thanks!
--
davide


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 15:58 [PATCH v2 net] net/sched: act_ife: initalize ife->metalist earlier Eric Dumazet
2020-01-15 16:07 ` Davide Caratti [this message]
2020-01-15 16:16   ` Eric Dumazet

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=f46117ffa869ca3ba7671b2dc38b6435b39b9c7a.camel@redhat.com \
    --to=dcaratti@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.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).