Re: [PATCH net-next v6 5/7] net: ethtool: Add new power limit get and set features

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 04 Jul 2024 10:12:00 +0200 Kory Maincent wrote:
> +	if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] ||
> +	    tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) {
> +		struct pse_control_config config = {};
> +
> +		if (pse_has_podl(phydev->psec))
> +			config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
> +		if (pse_has_c33(phydev->psec))
> +			config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);

This smells of null-deref if user only passes one of the attributes.
But the fix should probably be in ethnl_set_pse_validate() so it won't
conflict (I'm speculating that it will need to go to net).




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux