[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8a83042f83af92e87550085175da5c1d95cc4b0.camel@sipsolutions.net>
Date: Sat, 03 Apr 2021 18:26:04 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Pavel Skripkin <paskripkin@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: netlink: fix error check in
genl_family_rcv_msg_doit
On Sat, 2021-04-03 at 15:13 +0000, Pavel Skripkin wrote:
> genl_family_rcv_msg_attrs_parse() can return NULL
> pointer:
>
> if (!ops->maxattr)
> return NULL;
>
> But this condition doesn't cause an error in
> genl_family_rcv_msg_doit
And I'm almost certain that in fact it shouldn't cause an error!
If the family doesn't set maxattr then it doesn't want to have generic
netlink doing the parsing, but still it should be possible to call the
ops. Look at fs/dlm/netlink.c for example, it doesn't even have
attributes. You're breaking it with this patch.
Also, the (NULL) pointer is not actually _used_ anywhere, so why would
it matter?
johannes
Powered by blists - more mailing lists