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]
Date: Wed, 12 Jun 2024 12:23:05 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Joy Chakraborty <joychakr@...gle.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
	linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH] rtc: cmos: Fix return value of nvmem callbacks

On Wed, Jun 12, 2024 at 08:36:35AM +0000, Joy Chakraborty wrote:
> Read/write callbacks registered with nvmem core expect 0 to be returned
> on success and a negative value to be returned on failure.
> 
> cmos_nvram_read()/cmos_nvram_write() currently return the number of
> bytes read or written, fix to return 0 on success and -EIO incase number
> of bytes requested was not read or written.
> 
> Fixes: 8b5b7958fd1c ("rtc: cmos: use generic nvmem")
> Cc: stable@...r.kernel.org
> Signed-off-by: Joy Chakraborty <joychakr@...gle.com>
> ---

Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@...aro.org>

After we fix all the these, can we add a warning once message to detect
when people introduce new bugs?  It could either go into
__nvmem_reg_read/write() or bin_attr_nvmem_read/write().  I think
bin_attr_nvmem_read() is the only caller where the buggy functions work
but that's the caller that most people use I guess.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ