Re: [PATCH] x86/selftests: add clobbers for int80 on x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/10/2017 02:52 PM, Dmitry Safonov wrote:
Kernel erases R8..R11 registers prior returning to userspace
from int80: https://lkml.org/lkml/2009/10/1/164

GCC can reuse this registers and doesn't expect them to change
during syscall invocation. I met this kind of bug in CRIU once
gcc 6.1 and clang stored local variables in those registers
and the kernel zerofied them during syscall:
https://github.com/xemul/criu/commit/990d33f1a1cdd17bca6c2eb059ab3be2564f7fa2

By that reason I suggest to add those registers to clobbers
in selftests.

Cc: Shuah Khan <shuah@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: linux-kselftest@xxxxxxxxxxxxxxx
Signed-off-by: Dmitry Safonov <dsafonov@xxxxxxxxxxxxx>
---
 tools/testing/selftests/x86/fsgsbase.c            |  2 +-
 tools/testing/selftests/x86/iopl.c                | 10 ++++++++--

Drop this one: iopl doesn't do int80 - it's my failure in grepping.
Will resend.

 tools/testing/selftests/x86/ldt_gdt.c             | 16 +++++++++++-----
 tools/testing/selftests/x86/ptrace_syscall.c      |  3 ++-
 tools/testing/selftests/x86/single_step_syscall.c |  5 ++++-
 5 files changed, 26 insertions(+), 10 deletions(-)


--
             Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux