[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44456b54.180f2.18fa31eca2b.Coremail.linma@zju.edu.cn>
Date: Thu, 23 May 2024 09:44:15 +0800 (GMT+08:00)
From: "Lin Ma" <linma@....edu.cn>
To: "Simon Horman" <horms@...nel.org>
Cc: davem@...emloft.net, dsahern@...nel.org, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, yuehaibing@...wei.com,
larysa.zaremba@...el.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 net-next] ila: avoid genlmsg_reply when not ila_map
found
Hi Simon.
>
> Hi Lin Ma,
>
> The lines immediately above those covered by this patch are as follows:
>
> ret = -ESRCH;
> ila = ila_lookup_by_params(&xp, ilan);
> if (ila) {
> ret = ila_dump_info(ila,
>
> > @@ -483,6 +483,8 @@ int ila_xlat_nl_cmd_get_mapping(struct sk_buff *skb, struct genl_info *info)
> > info->snd_portid,
> > info->snd_seq, 0, msg,
> > info->genlhdr->cmd);
> > + } else {
> > + ret = -EINVAL;
> > }
> >
> > rcu_read_unlock();
>
> And the lines following, up to the end of the function, are:
>
> if (ret < 0)
> goto out_free;
>
> return genlmsg_reply(msg, info);
>
> out_free:
> nlmsg_free(msg);
> return ret;
>
> By my reading, without your patch, if ila is not found (NULL)
> then ret will be -ESRCH, and genlmsg_reply will not be called.
>
> I feel that I am missing something here.
Oh my bad, it seems this bug was already fixed by the
commit 693aa2c0d9b6 ("ila: do not generate empty messages
in ila_xlat_nl_cmd_get_mapping()") last year.
And my dated kernel does not apply that one.
Thanks for reminding me of this false alarm.
Regards
Lin
Powered by blists - more mailing lists