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: <20240906102150.GD2097826@kernel.org>
Date: Fri, 6 Sep 2024 11:21:50 +0100
From: Simon Horman <horms@...nel.org>
To: Zijun Hu <zijun_hu@...oud.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH] net: sysfs: Fix weird usage of class's namespace
 relevant fields

On Thu, Sep 05, 2024 at 07:35:38AM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@...cinc.com>
> 
> Device class has two namespace relevant fields which are associated by
> the following usage:
> 
> struct class {
> 	...
> 	const struct kobj_ns_type_operations *ns_type;
> 	const void *(*namespace)(const struct device *dev);
> 	...
> }
> if (dev->class && dev->class->ns_type)
> 	dev->class->namespace(dev);
> 
> The usage looks weird since it checks @ns_type but calls namespace()
> it is found for all existing class definitions that the other filed is
> also assigned once one is assigned in current kernel tree, so fix this
> weird usage by checking @namespace to call namespace().
> 
> Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
> ---
> driver-core tree has similar fix as shown below:
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=a169a663bfa8198f33a5c1002634cc89e5128025

Thanks,

I agree that this change is consistent with the one at the link above.
And that, given your explanation there and here, this change
makes sense.

Reviewed-by: Simon Horman <horms@...nel.org>

I don't think there is a need to repost because of this, but for future
reference, please keep in mind that patches like this - non bug fixes for
Networking code - should, in general, be targeted at net-next.

Subject: [PATCH net-next] ...

See: https://docs.kernel.org/process/maintainer-netdev.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ