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-next>] [day] [month] [year] [list]
Date:   Sat, 16 Jul 2022 16:50:08 +0800
From:   Zheyu Ma <zheyuma97@...il.com>
To:     t.schramm@...jaro.org, sre@...nel.org
Cc:     linux-pm@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] power: supply: cw2015: Found a bug when removing the module

Hello,

I found a bug in the cw2015 driver.

When I insmod the kernel module, I get the following log:

[  199.445154] cw2015 0-0010: probe
[  199.445447] cw2015 0-0010: No battery-profile found, using current
flash contents
[  199.447198] cw2015 0-0010: Can't check current battery profile, no
profile provided
[  199.448577] cw2015 0-0010: No monitored battery, some properties
will be missing
[  199.449556] i2c-core: driver [cw2015] registered
[  199.482970] cw2015 0-0010: No profile specified, continuing without profile
[  199.486086] cw2015 0-0010: Failed to get supply state: -19

And when I remove the module, I got the following warning:

[  200.470198] cw2015 0-0010: remove
[  200.471445] ------------[ cut here ]------------
[  200.472752] WARNING: CPU: 0 PID: 413 at drivers/base/devres.c:1058
devm_kfree+0x2a8/0x330
[  200.478314] RIP: 0010:devm_kfree+0x2a8/0x330
[  200.485019] Call Trace:
[  200.485226]  <TASK>
[  200.485405]  ? power_supply_put_battery_info+0xc2/0xe0
[  200.486169]  cw_bat_remove+0x89/0xa0 [cw2015_battery]
[  200.486570]  i2c_device_remove+0x181/0x1f0

I think the problem is that the driver fails to call the function
power_supply_get_battery_info(). However, when removing the module,
the driver executes power_supply_put_battery_info(), causing a
warning.

Since I'm not familiar with this driver, I will just report the bug to you.

regards,

Zheyu Ma

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ