]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Define arch_is_kernel_initmem_freed() for lockdep
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 27 Nov 2019 07:41:26 +0000 (18:41 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 27 Nov 2019 07:41:26 +0000 (18:41 +1100)
commitdce38ef73ae4c94eb4523a873d06789caa1c5163
tree051d6c22eea45269d5f65e1c00fd14bd60b79f7c
parent70f3b9b8efda7dd33153df67b0d7bf8bd7e97662
powerpc: Define arch_is_kernel_initmem_freed() for lockdep

Under certain circumstances, we hit a warning in lockdep_register_key:

        if (WARN_ON_ONCE(static_obj(key)))
                return;

This occurs when the key falls into initmem that has since been freed
and can now be reused. This has been observed on boot, and under
memory pressure.

Define arch_is_kernel_initmem_freed(), which allows lockdep to
correctly identify this memory as dynamic.

This fixes a bug picked up by the powerpc64 syzkaller instance where
we hit the WARN via alloc_netdev_mqs.

Reported-by: Qian Cai <cai@lca.pw>
Reported-by: ppc syzbot c/o Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Link: https://lore.kernel.org/r/87lfs4f7d6.fsf@dja-thinkpad.axtens.net
arch/powerpc/include/asm/sections.h