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] [day] [month] [year] [list]
Message-Id: <301AB844-A18F-48D6-9567-04E7C6586AF3@goldelico.com>
Date: Sat, 23 Aug 2025 12:31:06 +0200
From: "H. Nikolaus Schaller" <hns@...delico.com>
To: Jerry Lv <Jerry.Lv@...s.com>
Cc: Sebastian Reichel <sre@...nel.org>,
 Pali Rohár <pali@...nel.org>,
 "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "letux-kernel@...nphoenux.org" <letux-kernel@...nphoenux.org>,
 "stable@...r.kernel.org" <stable@...r.kernel.org>,
 "kernel@...a-handheld.com" <kernel@...a-handheld.com>,
 "andreas@...nade.info" <andreas@...nade.info>,
 Hermes Zhang <Hermes.Zhang@...s.com>
Subject: Re: [PATCH] power: supply: bq27xxx: fix error return in case of no
 bq27000 hdq battery

Hi Jerry,

> Am 05.08.2025 um 10:53 schrieb Jerry Lv <Jerry.Lv@...s.com>:
> 
> 
> But there is no similar check in the bq27xxx_battery_hdq_read() for the HDQ/1-wire driver. 
> Could we do the same check in the bq27xxx_battery_hdq_read(),
> instead of changing the cache.flags manually when the last byte in the returned data is 0xFF?
> Or could we just force to set the returned value to "-ENODEV" only when the last byte get from bq27xxx_battery_hdq_read() is 0xFF?

I tried to move the 0xff detection to bq27xxx_battery_hdq_read() and make it trigger only
for register 0x0a (BQ27XXX_REG_FLAGS), but there are other locations where bq27xxx_read()
is called for this register. And those emit error messages in case the battery is removed
while user-space is polling.

So I'll post a v2 with two patches (for different bugs):
a) set cache.flags to -ENODEV to fix the -EPERM bug
b) restrict the check for the 0xff condition to the bq27000 to avoid false positives for your bq27z561

BR and thanks,
Nikolaus


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ