]> Git Repo - linux.git/commit
kdump: write correct address of mem_section into vmcoreinfo
authorKirill A. Shutemov <[email protected]>
Sat, 13 Jan 2018 00:53:14 +0000 (16:53 -0800)
committerLinus Torvalds <[email protected]>
Sat, 13 Jan 2018 18:42:48 +0000 (10:42 -0800)
commita0b1280368d1e91ab72f849ef095b4f07a39bbf1
treeceb462448ba441496f73789d920c5b53ccf27476
parentd9570ee3bd1d4f20ce63485f5ef05663866fe6c0
kdump: write correct address of mem_section into vmcoreinfo

Depending on configuration mem_section can now be an array or a pointer
to an array allocated dynamically.  In most cases, we can continue to
refer to it as 'mem_section' regardless of what it is.

But there's one exception: '&mem_section' means "address of the array"
if mem_section is an array, but if mem_section is a pointer, it would
mean "address of the pointer".

We've stepped onto this in kdump code.  VMCOREINFO_SYMBOL(mem_section)
writes down address of pointer into vmcoreinfo, not array as we wanted.

Let's introduce VMCOREINFO_SYMBOL_ARRAY() that would handle the
situation correctly for both cases.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Kirill A. Shutemov <[email protected]>
Fixes: 83e3c48729d9 ("mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y")
Acked-by: Baoquan He <[email protected]>
Acked-by: Dave Young <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Dave Young <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Vivek Goyal <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/crash_core.h
kernel/crash_core.c
This page took 0.057 seconds and 4 git commands to generate.