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: <CAKv+Gu-XAOETMCtmePeBKJYbf1EoB2K9BeN0ja0UPXa9ho175A@mail.gmail.com>
Date:   Tue, 13 Feb 2018 18:40:48 +0000
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Jia-Ju Bai <baijiaju1990@...il.com>,
        Matt Fleming <matt@...eblueprint.co.uk>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        linux-efi@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store

On 13 February 2018 at 18:07, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Jia-Ju Bai <baijiaju1990@...il.com> wrote:
>
>> The function kzalloc here is not called in atomic context.
>> If nonblocking in efi_query_variable_store is true,
>> namely it is in atomic context, efi_query_variable_store will return before
>> this kzalloc is called.
>> Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
>>
>> This is found by a static analysis tool named DCNS written by myself.
>>
>> Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
>> ---
>>  arch/x86/platform/efi/quirks.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
>> index 8a99a2e..b6dcb52 100644
>> --- a/arch/x86/platform/efi/quirks.c
>> +++ b/arch/x86/platform/efi/quirks.c
>> @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size,
>>                * that by attempting to use more space than is available.
>>                */
>>               unsigned long dummy_size = remaining_size + 1024;
>> -             void *dummy = kzalloc(dummy_size, GFP_ATOMIC);
>> +             void *dummy = kzalloc(dummy_size, GFP_KERNEL);
>
> Looks good to me!
>
> Reviewed-by: Ingo Molnar <mingo@...nel.org>
>

Queued in linux-efi/next

Thanks all.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ