Skip to content

x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

Lianbo Jiang kexec lkml 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest3 patches 4 repliesIn review
  2. v8 posting 2/22 patches 4 repliesSuperseded
  3. v8 posting 1/22 patches 1 replySuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v72 patches4 repliesSuperseded
v62 patches2 repliesSuperseded
v52 patches7 repliesSuperseded
v43 patches11 repliesSuperseded
v33 patches12 repliesSuperseded
v21 patch6 repliesSuperseded
v11 patch9 repliesSuperseded

Changes in v9 from the cover letter

[1] Fix some build warnings reported by kbuild and make it as a separate patch.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/kdump: always reserve the low 1M when the crashkernel option is specifiedarch/x86/include/asm/crash.h arch/x86/kernel/crash.c arch/x86/realmode/init.c+23 -00 replies
2/3x86/kdump: clean up all the code related to the backup regionarch/x86/include/asm/kexec.h arch/x86/include/asm/purgatory.h arch/x86/kernel/crash.c +2 more+11 -1620 replies
3/3kexec: Fix i386 build warnings that missed declaration of struct kimagearch/x86/include/asm/crash.h+2 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v9 yet.

Read the v9 thread

Cover letter [PATCH 0/3 v9] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

In purgatory(), the main things are as below:

[1] verify sha256 hashes for various segments. Lets keep these codes, and do not touch the logic.

[2] copy the first 640k content to a backup region.
Lets safely remove it and clean all code related to backup region.

This patch series will remove the backup region, because the current handling of copying the first 640k runs into problems when SME is active(https://bugzilla.kernel.org/show_bug.cgi?id=204793).

The low 1M region will always be reserved when the crashkernel kernel command line option is specified. And this way makes it unnecessary to do anything with the low 1M region, because the memory allocated later won't fall into the low 1M area.

This series includes three patches:
[1] x86/kdump: always reserve the low 1M when the crashkernel option is specified
The low 1M region will always be reserved when the crashkernel kernel command line option is specified, which ensures that the memory allocated later won't fall into the low 1M area.

[2] x86/kdump: clean up all the code related to the backup region Remove the backup region and clean up.

[3] kexec: Fix i386 build warnings that missed declaration of struct kimage

Changes since v1:
[1] Add extra checking condition: when the crashkernel option is specified, reserve the low 640k area.

Changes since v2:
[1] Reserve the low 1M region when the crashkernel option is only specified.(Suggested by Eric)

[2] Remove the unused crash_copy_backup_region()

[3] Remove the backup region and clean up

[4] Split them into three patches

Changes since v3:
[1] Improve the first patch's log

[2] Improve the third patch based on Eric's suggestions

Changes since v4:
[1] Correct some typos, and also improve the first patch's log

[2] Add a new function kexec_reserve_low_1MiB() in kernel/kexec_core.c and which is called by reserve_real_mode(). (Suggested by Boris)

Changes since v5:
[1] Call the cmdline_find_option() instead of strstr() to check the crashkernel option. (Suggested by Hatayama)

[2] Add a weak function kexec_reserve_low_1MiB() in kernel/kexec_core.c, and implement the kexec_reserve_low_1MiB() in arch/x86/kernel/ machine_kexec_64.c so that it does not cause the compile error on non-x86 kernel, and also ensures that it can work well on x86 kernel.

Changes since v6:
[1] Move the kexec_reserve_low_1MiB() to arch/x86/kernel/crash.c and also move its declaration function to arch/x86/include/asm/crash.h (Suggested by Dave Young)

[2] Adjust the corresponding header files.

Changes since v7:
[1] Change the function name from kexec_reserve_low_1MiB() to

    crash_reserve_low_1M().

[2] Fix some warnings reported by kduild.

Changes since v8:
[1] Fix some build warnings reported by kbuild and make it as a separate patch.

Lianbo Jiang (3):
x86/kdump: always reserve the low 1M when the crashkernel option is
specified
x86/kdump: clean up all the code related to the backup region
kexec: Fix i386 build warnings that missed declaration of struct
kimage

 arch/x86/include/asm/crash.h       |   8 +++
 arch/x86/include/asm/kexec.h       |  10 ---
 arch/x86/include/asm/purgatory.h   |  10 ---
 arch/x86/kernel/crash.c            | 102 ++++++++---------------------
 arch/x86/kernel/machine_kexec_64.c |  47 -------------
 arch/x86/purgatory/purgatory.c     |  19 ------
 arch/x86/realmode/init.c           |   2 +
 7 files changed, 36 insertions(+), 162 deletions(-)
Signature · 1 line
2.17.1