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_1ckSP_O6TdYRL=+dUbWDsogOaU3-nnWMKijtANw8t6Q@mail.gmail.com>
Date:   Thu, 8 Nov 2018 18:25:22 +0100
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     Qian Cai <cai@....us>, Marc Zyngier <marc.zyngier@....com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux-MM <linux-mm@...ck.org>,
        linux-efi <linux-efi@...r.kernel.org>
Subject: Re: BUG: sleeping function called from invalid context at mm/slab.h:421

(+ Marc)

On 8 November 2018 at 18:22, Qian Cai <cai@....us> wrote:
> Looks like more of an EFI issue where it called efi_mem_reserve_persistent().
>
>> Sent: Thursday, November 08, 2018 at 11:23 AM
>> From: "Qian Cai" <cai@....us>
>> To: linux-kernel@...r.kernel.org
>> Cc: linux-mm@...ck.org
>> Subject: BUG: sleeping function called from invalid context at mm/slab.h:421
>>
>> Just booting up the latest git master (b00d209) on an aarch64 server and saw this.
>>
>> Nov  8 11:06:36 huawei-t2280-03 kernel: BUG: sleeping function called from invalid context at mm/slab.h:421
>> Nov  8 11:06:36 huawei-t2280-03 kernel: in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/1
>> Nov  8 11:06:36 huawei-t2280-03 kernel: no locks held by swapper/1/0.
>> Nov  8 11:06:36 huawei-t2280-03 kernel: irq event stamp: 0
>> Nov  8 11:06:36 huawei-t2280-03 kernel: hardirqs last  enabled at (0): [<0000000000000000>]           (null)
>> Nov  8 11:06:36 huawei-t2280-03 kernel: hardirqs last disabled at (0): [<ffff2000080e24ec>] copy_process.isra.32.part.33+0x460/0x1534
>> Nov  8 11:06:36 huawei-t2280-03 kernel: softirqs last  enabled at (0): [<ffff2000080e24ec>] copy_process.isra.32.part.33+0x460/0x1534
>> Nov  8 11:06:36 huawei-t2280-03 kernel: softirqs last disabled at (0): [<0000000000000000>]           (null)
>> Nov  8 11:06:36 huawei-t2280-03 kernel: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.20.0-rc1+ #3
>> Nov  8 11:06:36 huawei-t2280-03 kernel: Call trace:
>> Nov  8 11:06:36 huawei-t2280-03 kernel: dump_backtrace+0x0/0x190
>> Nov  8 11:06:36 huawei-t2280-03 kernel: show_stack+0x24/0x2c
>> Nov  8 11:06:36 huawei-t2280-03 kernel: dump_stack+0xa4/0xe0
>> Nov  8 11:06:36 huawei-t2280-03 kernel: ___might_sleep+0x208/0x234
>> Nov  8 11:06:36 huawei-t2280-03 kernel: __might_sleep+0x58/0x8c
>> Nov  8 11:06:36 huawei-t2280-03 kernel: kmem_cache_alloc_trace+0x29c/0x420
>> Nov  8 11:06:36 huawei-t2280-03 kernel: efi_mem_reserve_persistent+0x50/0xe8
>> Nov  8 11:06:36 huawei-t2280-03 kernel: its_cpu_init_lpis+0x298/0x2e0
>> Nov  8 11:06:36 huawei-t2280-03 kernel: its_cpu_init+0x7c/0x1a8
>> Nov  8 11:06:36 huawei-t2280-03 kernel: gic_starting_cpu+0x28/0x34
>> Nov  8 11:06:36 huawei-t2280-03 kernel: cpuhp_invoke_callback+0x104/0xd04
>> Nov  8 11:06:36 huawei-t2280-03 kernel: notify_cpu_starting+0x60/0xa0
>> Nov  8 11:06:36 huawei-t2280-03 kernel: secondary_start_kernel+0xcc/0x178
>>
>> Any idea?

OK, so apparently, we are being invoked from atomic context

Please try this

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 249eb70691b0..44ed6792de7c 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -971,7 +971,7 @@ int efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
        if (efi.mem_reserve == EFI_INVALID_TABLE_ADDR)
                return -ENODEV;

-       rsv = kmalloc(sizeof(*rsv), GFP_KERNEL);
+       rsv = kmalloc(sizeof(*rsv), GFP_ATOMIC);
        if (!rsv)
                return -ENOMEM;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ