[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DM6PR12MB45169D23F12F3680FF8E07F8D87B2@DM6PR12MB4516.namprd12.prod.outlook.com>
Date: Wed, 24 Jan 2024 15:46:55 +0000
From: Danielle Ratson <danieller@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>, "corbet@....net" <corbet@....net>,
"linux@...linux.org.uk" <linux@...linux.org.uk>, "sdf@...gle.com"
<sdf@...gle.com>, "kory.maincent@...tlin.com" <kory.maincent@...tlin.com>,
"maxime.chevallier@...tlin.com" <maxime.chevallier@...tlin.com>,
"vladimir.oltean@....com" <vladimir.oltean@....com>,
"przemyslaw.kitszel@...el.com" <przemyslaw.kitszel@...el.com>,
"ahmed.zaki@...el.com" <ahmed.zaki@...el.com>, "richardcochran@...il.com"
<richardcochran@...il.com>, "shayagr@...zon.com" <shayagr@...zon.com>,
"paul.greenwalt@...el.com" <paul.greenwalt@...el.com>, "jiri@...nulli.us"
<jiri@...nulli.us>, "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, mlxsw
<mlxsw@...dia.com>, Petr Machata <petrm@...dia.com>, Ido Schimmel
<idosch@...dia.com>
Subject: RE: [RFC PATCH net-next 9/9] ethtool: Add ability to flash
transceiver modules' firmware
> > > GENL_REQ_ATTR_CHECK, and you can check it in the caller, before
> > > taking rtnl_lock.
> > >
> >
> > OK, np. The idea was to have module_flash_fw() that checks the attrs
> > and extract them into params and ethnl_act_module_fw_flash() should be
> > free from those checks. But if so, maybe this separation is redundant
> > and should combine the two?
>
> No strong preference, whatever looks better :) To use
> GENL_REQ_ATTR_CHECK() I think you'll need to pass genl_info here.
> You can either to that or move the validation.
>
> > > > +
> > > tb[ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME],
> > > > + "File name attribute is missing");
> > > > + return -EINVAL;
> > > > + }
> > > > +
> > > > + params.file_name =
> > > > + nla_data(tb[ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME]);
> > >
> > > Hm. I think you copy the param struct by value to the work container.
> > > nla_data() is in the skb which is going to get freed after _ACT returns.
> > > So if anyone tries to access the name from the work it's going to UAF?
> >
> > The file_name parameter is not really needed inside the work. Once we
> > called request_firmware_direct(), we have all that we need in
> > module_fw->fw. Do we still need to avoid that situation? If so, can
> > you please suggest how?
>
> I'd pass it to module_flash_fw_schedule() as a separate argument, if it doesn't
> have to be saved.
It doesn’t make the module_fw->file_name attribute redundant?
Powered by blists - more mailing lists