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: <85683284-db85-7e3a-57bd-750e1c204e3e@igalia.com>
Date:   Thu, 1 Sep 2022 14:46:48 -0300
From:   "Guilherme G. Piccoli" <gpiccoli@...lia.com>
To:     Greg KH <gregkh@...uxfoundation.org>, evgreen@...omium.org
Cc:     arnd@...db.de, linux-efi@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel@...ccoli.net, ardb@...nel.org,
        davidgow@...gle.com, jwerner@...omium.org,
        Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH V3] firmware: google: Test spinlock on panic path to avoid
 lockups

On 01/09/2022 13:44, Greg KH wrote:
> [...]
>>> How are we supposed to know this here?
>>>
>>
>> Reading the code?
>> Or you mean, in the commit description this should be mentioned?
> 
> Yes, and in the comment as this type of call is very rare and should
> almost never be used.

OK, I can add that, for sure.


>> [...]
>> I don't think it is so simple - we are in the panic path.
> 
> Great, then the lock doesn't matter :)
> 
>> So, imagine the lock was taken in CPU0, where GSMI is doing some
>> operation. During that operation, CPU1 panics!
>>
>> When that happens, panic() executes in CPU1, disabling CPU0 through
>> "strong" mechanisms (NMI). So, CPU0 had the lock, it is now off, and
>> when CPU1 goes through the panic notifiers, it'll eventually wait
>> forever for this lock in the GSMI handler, unless we have this patch
>> that would prevent the handler to run in such case.
>> Makes sense?
> 
> I'm trying to say "if you are in panic, never grab the lock in the first
> place".  So change the place when you grab the lock, not here.
> 

Evan, any comment here?
I think the patch is still well suited for this case. Suggestions on how
to improve it are welcome, of course.

I honestly didn't understand exactly what you're suggesting Greg...
Mind clarifying?

Cheers,


Guilherme

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ