Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names

Instead of having the core code guess the note name for each regset,
use USER_REGSET_NOTE_TYPE() to pick the correct name from elf.h.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: linux-sh@vger.kernel.org
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250701135616.29630-19-Dave.Martin@arm.com
Signed-off-by: Kees Cook <kees@kernel.org>

authored by

Dave Martin and committed by
Kees Cook
afe74eec d6a883cb

+2 -2
+2 -2
arch/sh/kernel/ptrace_32.c
··· 291 291 * PC, PR, SR, GBR, MACH, MACL, TRA 292 292 */ 293 293 [REGSET_GENERAL] = { 294 - .core_note_type = NT_PRSTATUS, 294 + USER_REGSET_NOTE_TYPE(PRSTATUS), 295 295 .n = ELF_NGREG, 296 296 .size = sizeof(long), 297 297 .align = sizeof(long), ··· 301 301 302 302 #ifdef CONFIG_SH_FPU 303 303 [REGSET_FPU] = { 304 - .core_note_type = NT_PRFPREG, 304 + USER_REGSET_NOTE_TYPE(PRFPREG), 305 305 .n = sizeof(struct user_fpu_struct) / sizeof(long), 306 306 .size = sizeof(long), 307 307 .align = sizeof(long),