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: <4A0BAE9B.1090401@compulab.co.il>
Date:	Thu, 14 May 2009 08:39:39 +0300
From:	Mike Rapoport <mike@...pulab.co.il>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	cbou@...l.ru, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] da9030_battery: fix race between event handler and monitor



Andrew Morton wrote:
> On Tue, 12 May 2009 10:20:09 +0300
> Mike Rapoport <mike@...pulab.co.il> wrote:
> 
>> Signed-off-by: Mike Rapoport <mike@...pulab.co.il>
> 
> We seem to be missing a changelog.

My bad...

>> diff --git a/drivers/power/da9030_battery.c b/drivers/power/da9030_battery.c
>> index 1662bb0..3364198 100644
>> --- a/drivers/power/da9030_battery.c
>> +++ b/drivers/power/da9030_battery.c
>> @@ -22,8 +22,6 @@
>>  #include <linux/debugfs.h>
>>  #include <linux/seq_file.h>

[ snip ]

> What is this race? What are the user-visible effects when it occurs? 

There are cases when charging monitor and the event handler try to change the
charger state simultaneously. For instance, a charger is connected to the
system, there's the detection event and the event handler tries to enable
charging. It is possible that the periodic charging monitor runs at the same
time and it still thinks there's no external charger. So it tries to disable the
charging. As the result, even if the conditions necessary to charge the battery
hold, there will be no actual charging.

> How does the patch fix the race?

The patch changes the event handler so that instead of enabling/disabling the
charger immediately it would rather make the monitor run. The monitor code then
decides what should be the charger state.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Sincerely yours,
Mike.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ