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:
 <DS0PR18MB528549682B139522F013838FB79CA@DS0PR18MB5285.namprd18.prod.outlook.com>
Date: Mon, 19 May 2025 11:07:44 +0000
From: Igor Russkikh <irusskikh@...vell.com>
To: Wentao Liang <vulab@...as.ac.cn>,
        "andrew+netdev@...n.ch"
	<andrew+netdev@...n.ch>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org"
	<kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Jackson Pooyappadam
	<jpooyappadam@...vell.com>
Subject: RE: [EXTERNAL] [PATCH] net: atlantic: Add error handling in
 set_raw_ingress_record()

> The set_raw_ingress_record() calls aq_mss_mdio_write() but does not check the return value. A proper implementation can be found in get_raw_ingress_record(). Add error handling for aq_mss_mdio_write(). If the write fails, return immediately. 
> 
> The set_raw_ingress_record() calls aq_mss_mdio_write() but does not
> check the return value. A proper implementation can be found in
> get_raw_ingress_record().
> 
> Add error handling for aq_mss_mdio_write(). If the write fails,
> return immediately.

Hi Wentao,

aq_mss_mdio_write is practically always returns success as of today.

So introducing your change without actually making aq_mss_mdio_write and aq_mdio_write_word returning error code is useless IMHO.

> +	ret = aq_mss_mdio_write(hw, MDIO_MMD_VEND1,
> +				MSS_INGRESS_LUT_ADDR_CTL_REGISTER_ADDR,
> +				lut_sel_reg.word_0);
> +	if (unlikely(ret))
> +		return ret;
> +	ret = aq_mss_mdio_write(hw, MDIO_MMD_VEND1, MSS_INGRESS_LUT_CTL_REGISTER_ADDR,
> +				lut_op_reg.word_0);
> +	if (unlikely(ret))
> +		return ret;

You introduce checks only for the two last operations, but not for many others above them. Any reason to do so?

Overall, I think if you want to improve in this direction:
1) we should propagate error conditions from aq_mdio_write_word
2) all instances of aq_mss_mdio_write should have checks for err condition
3) this is not actually a bug, but improvement - therefore make sense to post this into net-next.

Regards,
   Igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ