lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250706230628.240966-1-d-tatianin@yandex-team.ru>
Date: Mon,  7 Jul 2025 02:06:28 +0300
From: Daniil Tatianin <d-tatianin@...dex-team.ru>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Daniil Tatianin <d-tatianin@...dex-team.ru>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Huth <thuth@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] arch/x86/ptrace: remove misleading comments about pt_regs

This comment hasn't been true for at least 10 years, ever since commit
ff467594f2a4 ("x86/asm/entry/64: Save all regs on interrupt entry").

Remove to prevent reader confusion.

Signed-off-by: Daniil Tatianin <d-tatianin@...dex-team.ru>
---
 arch/x86/include/asm/ptrace.h          | 8 ++------
 arch/x86/include/uapi/asm/ptrace-abi.h | 7 ++-----
 arch/x86/include/uapi/asm/ptrace.h     | 7 ++-----
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 50f75467f73d..dcc6f8beae2c 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -101,11 +101,7 @@ struct fred_ss {
 };
 
 struct pt_regs {
-	/*
-	 * C ABI says these regs are callee-preserved. They aren't saved on
-	 * kernel entry unless syscall needs a complete, fully filled
-	 * "struct pt_regs".
-	 */
+	/* C ABI says these regs are callee-preserved. */
 	unsigned long r15;
 	unsigned long r14;
 	unsigned long r13;
@@ -113,7 +109,7 @@ struct pt_regs {
 	unsigned long bp;
 	unsigned long bx;
 
-	/* These regs are callee-clobbered. Always saved on kernel entry. */
+	/* These regs are callee-clobbered. */
 	unsigned long r11;
 	unsigned long r10;
 	unsigned long r9;
diff --git a/arch/x86/include/uapi/asm/ptrace-abi.h b/arch/x86/include/uapi/asm/ptrace-abi.h
index 5823584dea13..b06535b1226b 100644
--- a/arch/x86/include/uapi/asm/ptrace-abi.h
+++ b/arch/x86/include/uapi/asm/ptrace-abi.h
@@ -26,17 +26,14 @@
 #else /* __i386__ */
 
 #if defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)
-/*
- * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
- * unless syscall needs a complete, fully filled "struct pt_regs".
- */
+/* C ABI says these regs are callee-preserved. */
 #define R15 0
 #define R14 8
 #define R13 16
 #define R12 24
 #define RBP 32
 #define RBX 40
-/* These regs are callee-clobbered. Always saved on kernel entry. */
+/* These regs are callee-clobbered. */
 #define R11 48
 #define R10 56
 #define R9 64
diff --git a/arch/x86/include/uapi/asm/ptrace.h b/arch/x86/include/uapi/asm/ptrace.h
index e0b5b4f6226b..c48e56bc6fa0 100644
--- a/arch/x86/include/uapi/asm/ptrace.h
+++ b/arch/x86/include/uapi/asm/ptrace.h
@@ -42,17 +42,14 @@ struct pt_regs {
 #ifndef __KERNEL__
 
 struct pt_regs {
-/*
- * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
- * unless syscall needs a complete, fully filled "struct pt_regs".
- */
+/* C ABI says these regs are callee-preserved. */
 	unsigned long r15;
 	unsigned long r14;
 	unsigned long r13;
 	unsigned long r12;
 	unsigned long rbp;
 	unsigned long rbx;
-/* These regs are callee-clobbered. Always saved on kernel entry. */
+/* These regs are callee-clobbered. */
 	unsigned long r11;
 	unsigned long r10;
 	unsigned long r9;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ