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: <1CAD8EC3-21B3-46BF-82BD-04921126C1B3@lca.pw>
Date:   Thu, 21 Nov 2019 12:13:27 -0500
From:   Qian Cai <cai@....pw>
To:     Michael Ellerman <mpe@...erman.id.au>
Cc:     Bart Van Assche <bvanassche@....org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>, linuxppc-dev@...ts.ozlabs.org,
        linux-kernel@...r.kernel.org
Subject: Re: lockdep warning while booting POWER9 PowerNV



> On Sep 4, 2019, at 11:55 PM, Michael Ellerman <mpe@...erman.id.au> wrote:
> 
> Bart Van Assche <bvanassche@....org> writes:
>> On 8/30/19 2:13 PM, Qian Cai wrote:
>>> https://raw.githubusercontent.com/cailca/linux-mm/master/powerpc.config
>>> 
>>> Once in a while, booting an IBM POWER9 PowerNV system (8335-GTH) would generate
>>> a warning in lockdep_register_key() at,
>>> 
>>> if (WARN_ON_ONCE(static_obj(key)))
>>> 
>>> because
>>> 
>>> key = 0xc0000000019ad118
>>> &_stext = 0xc000000000000000
>>> &_end = 0xc0000000049d0000
>>> 
>>> i.e., it will cause static_obj() returns 1.
>> 
>> (back from a trip)
>> 
>> Hi Qian,
>> 
>> Does this mean that on POWER9 it can happen that a dynamically allocated 
>> object has an address that falls between &_stext and &_end?
> 
> I thought that was true on all arches due to initmem, but seems not.
> 
> I guess we have the same problem as s390 and we need to define
> arch_is_kernel_initmem_freed().
> 
> Qian, can you try this:
> 
> diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
> index 4a1664a8658d..616b1b7b7e52 100644
> --- a/arch/powerpc/include/asm/sections.h
> +++ b/arch/powerpc/include/asm/sections.h
> @@ -5,8 +5,22 @@
> 
> #include <linux/elf.h>
> #include <linux/uaccess.h>
> +
> +#define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed
> +
> #include <asm-generic/sections.h>
> 
> +extern bool init_mem_is_free;
> +
> +static inline int arch_is_kernel_initmem_freed(unsigned long addr)
> +{
> +	if (!init_mem_is_free)
> +		return 0;
> +
> +	return addr >= (unsigned long)__init_begin &&
> +		addr < (unsigned long)__init_end;
> +}
> +
> extern char __head_end[];
> 
> #ifdef __powerpc64__
> 

Michael, this fix is also needed as it starts to trigger another one of those where the allocated
memory is from initmem. 

[   31.326825] key = c0000000019049a0
[   31.326862] stext = c000000000000000, end = c0000000070e0000
[   31.326907] init_start = c000000000c70000, init_end = c0000000020f0000

[   31.325021] WARNING: CPU: 0 PID: 5 at kernel/locking/lockdep.c:1121 lockdep_register_key+0xb4/0x340
[   31.325061] Modules linked in: tg3(+) ahci(+) libahci libata mdio libphy firmware_class dm_mirror dm_region_hash dm_log dm_mod
[   31.325128] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.4.0-rc8-next-20191120+ #4
[   31.325190] Workqueue: events work_for_cpu_fn
[   31.325215] NIP:  c0000000001a23a4 LR: c00000000075eccc CTR: 0000000000000000
[   31.325257] REGS: c00000002e72f4c0 TRAP: 0700   Not tainted  (5.4.0-rc8-next-20191120+)
[   31.325320] MSR:  900000000282b033 <SF,HV,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 48000c20  XER: 20040000
[   31.325392] CFAR: c0000000001a233c IRQMASK: 0 
               GPR00: c00000000075eccc c00000002e72f750 c000000002cff500 c0000000070df500 
               GPR04: c0000014beb01990 c0000000019042b8 0000000000000000 0000000000000000 
               GPR08: 0000000000000000 0000000000000000 c000000000425e28 c00c000004761020 
               GPR12: 0000000000000000 c0000000070e0000 c00000002e5214f8 c000001ffca018c8 
               GPR16: c000001ffca018e4 c000001ffca01c80 c000001ffca018d0 c00000002e6e3e48 
               GPR20: c000000002cbf500 c00000002e520080 c000001ffca05408 c00000002e6e3e00 
               GPR24: c0000000007d36d0 0000000000000005 0000000000000005 c000000001904000 
               GPR28: c0000000070e0000 c000000000000000 c0000000019049a0 c00000002e72f7f0 
[   31.325765] NIP [c0000000001a23a4] lockdep_register_key+0xb4/0x340
[   31.325809] LR [c00000000075eccc] alloc_netdev_mqs+0x15c/0x500
[   31.325848] Call Trace:
[   31.325886] [c00000002e72f750] [0000000000000005] 0x5 (unreliable)
[   31.325930] [c00000002e72f7f0] [c00000000075eccc] alloc_netdev_mqs+0x15c/0x500
[   31.325984] [c00000002e72f8d0] [c0000000007d37f0] alloc_etherdev_mqs+0x60/0x90
[   31.326047] [c00000002e72f910] [c00800000f150110] tg3_init_one+0x108/0x1d00 [tg3]
[   31.326098] [c00000002e72fac0] [c000000000633b48] local_pci_probe+0x78/0x100
[   31.326143] [c00000002e72fb50] [c000000000134b60] work_for_cpu_fn+0x40/0x70
[   31.326190] [c00000002e72fb80] [c00000000013927c] process_one_work+0x3ac/0x710
[   31.326221] [c00000002e72fc70] [c000000000138d90] process_scheduled_works+0x60/0xa0
[   31.326274] [c00000002e72fcb0] [c000000000139ba4] worker_thread+0x344/0x4a0
[   31.326317] [c00000002e72fda0] [c000000000142f68] kthread+0x1b8/0x1e0
[   31.326363] [c00000002e72fe20] [c00000000000b748] ret_from_kernel_thread+0x5c/0x74
[   31.326412] Instruction dump:
[   31.326448] 28230000 418200a0 7fc3f378 48191fd9 60000000 70630001 41810018 7fc3f378 
[   31.326510] 4807fe25 60000000 70630001 40810060 <0fe00000> 3c62fffc 8883fa2f 70840001 
[   31.326573] irq event stamp: 806
[   31.326617] hardirqs last  enabled at (805): [<c0000000008daa4c>] _raw_write_unlock_irqrestore+0x5c/0xc0
[   31.326666] hardirqs last disabled at (806): [<c000000000008fbc>] program_check_common+0x21c/0x230
[   31.326710] softirqs last  enabled at (0): [<c0000000000fa098>] copy_process+0x688/0x1850
[   31.326752] softirqs last disabled at (0): [<0000000000000000>] 0x0
[   31.326791] ---[ end trace c9674d7f7d278f30 ]---


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ