lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZW4ClD9JC22qh90E@smile.fi.intel.com>
Date: Mon, 4 Dec 2023 18:47:16 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: Przemek Kitszel <przemyslaw.kitszel@...el.com>, kuba@...nel.org,
	pabeni@...hat.com, davem@...emloft.net, edumazet@...gle.com,
	jacob.e.keller@...el.com, jhs@...atatu.com,
	johannes@...solutions.net, amritha.nambiar@...el.com,
	sdf@...gle.com, horms@...nel.org, netdev@...r.kernel.org
Subject: Re: [patch net-next v4 8/9] devlink: add a command to set
 notification filter and use it for multicasts

On Mon, Dec 04, 2023 at 05:24:34PM +0100, Jiri Pirko wrote:
> Mon, Nov 27, 2023 at 04:40:22PM CET, przemyslaw.kitszel@...el.com wrote:
> >On 11/23/23 19:15, Jiri Pirko wrote:

[...]

> >> +	size_t data_size = 0;
> >> +	char *pos;
> >> +
> >> +	if (attrs[DEVLINK_ATTR_BUS_NAME])
> >> +		data_size += nla_len(attrs[DEVLINK_ATTR_BUS_NAME]) + 1;
> >> +	if (attrs[DEVLINK_ATTR_DEV_NAME])
> >> +		data_size += nla_len(attrs[DEVLINK_ATTR_DEV_NAME]) + 1;
> >> +
> >> +	flt = kzalloc(sizeof(*flt) + data_size, GFP_KERNEL);
> >
> >instead of arithmetic here, you could use struct_size()
> 
> That is used for flex array, yet I have no flex array here.

It feels like you use flexible array even if you have the top limit of
the size. But yeah, the attributes seem out of the variadic length and
struct_size() here won't help anyway.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ