Power management fix for v4.8-rc1

Fix a nasty (and really hard to debug) memory corruption during
 resume from hibernation on x86-64 (that leads to a kernel panic
 most of the time) due to the use of a stale stack pointer value
 in FRAME_BEGIN (Josh Poimboeuf).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJXm76YAAoJEILEb/54YlRxBu0QAIwOnS0YJO/AuXNNEUxzK3xu
 /+nRda38MJVUeoU/Z8wBkf5l8XEzNgYZPabj87r4Dkyg32dWKXHwW8R9ApyO1RfA
 7CReTgO2rKfOrDWCq2uYdea0hKM36vavjUHGJ+fSScaqHWaGSqvqeHusroUDL+3y
 grRI8GDNyfG1eV9IxrJwcE0Oegp0QKX5saSKXXVoeaM63YnNUwv9usdEOpdE1lmk
 r6WwpYNZSh/vjaNlLEcrmEAbU3Nv/wBNqGBkoZoATgTT0YsONfqUJcU3fhVXeNMR
 u3Tnk2HJZUmJ3HQgFBcpGU5r1/c/qX8PzPK7e3D60QDgztkADCroW9WOYfwICs+A
 qmsCUs0bVyqxUOBWLIbyJ/n9/VzkeE/cD3lOjkGh/ChRZWpUeDobJWeoseMxDzG5
 21kOwEQvel9Itk8C57zoWCvuSNddg9M2f/GL7yoYtyqKrMriRwwqftIOhJocySP0
 2eONtBn2be9IUX/cdSuVVnqvWP9pGCXqr4IJZoormX3lf1Zi+/G9buPo0At35k5F
 kHxRhnAGsnYxolAhVboxQdkGItrP0LlDvXLnLzPhWjz8qOLOkZpnIfpjsj+bwF7K
 2S+Yr3oBldxIYu1A+jne/fOiTUiQ5iAicWnLwNQpmETWu/+Rz72bweWRUYiE71mW
 H0M0HaD9UzhockpqpeEM
 =O25M
 -----END PGP SIGNATURE-----

Merge tag 'pm-urgent-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
 "Fix a nasty (and really hard to debug) memory corruption during resume
  from hibernation on x86-64 (that leads to a kernel panic most of the
  time) due to the use of a stale stack pointer value in FRAME_BEGIN
  (Josh Poimboeuf)"

* tag 'pm-urgent-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  x86/power/64: Fix hibernation return address corruption
This commit is contained in:
Linus Torvalds 2016-07-29 14:34:55 -07:00
commit 601f887d61
1 changed files with 1 additions and 3 deletions

View File

@ -24,7 +24,6 @@
#include <asm/frame.h> #include <asm/frame.h>
ENTRY(swsusp_arch_suspend) ENTRY(swsusp_arch_suspend)
FRAME_BEGIN
movq $saved_context, %rax movq $saved_context, %rax
movq %rsp, pt_regs_sp(%rax) movq %rsp, pt_regs_sp(%rax)
movq %rbp, pt_regs_bp(%rax) movq %rbp, pt_regs_bp(%rax)
@ -48,6 +47,7 @@ ENTRY(swsusp_arch_suspend)
movq %cr3, %rax movq %cr3, %rax
movq %rax, restore_cr3(%rip) movq %rax, restore_cr3(%rip)
FRAME_BEGIN
call swsusp_save call swsusp_save
FRAME_END FRAME_END
ret ret
@ -104,7 +104,6 @@ ENTRY(core_restore_code)
/* code below belongs to the image kernel */ /* code below belongs to the image kernel */
.align PAGE_SIZE .align PAGE_SIZE
ENTRY(restore_registers) ENTRY(restore_registers)
FRAME_BEGIN
/* go back to the original page tables */ /* go back to the original page tables */
movq %r9, %cr3 movq %r9, %cr3
@ -145,6 +144,5 @@ ENTRY(restore_registers)
/* tell the hibernation core that we've just restored the memory */ /* tell the hibernation core that we've just restored the memory */
movq %rax, in_suspend(%rip) movq %rax, in_suspend(%rip)
FRAME_END
ret ret
ENDPROC(restore_registers) ENDPROC(restore_registers)