]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
authorDave Martin <Dave.Martin@arm.com>
Tue, 1 Jul 2025 13:56:11 +0000 (14:56 +0100)
committerKees Cook <kees@kernel.org>
Tue, 15 Jul 2025 05:27:48 +0000 (22:27 -0700)
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>
arch/sh/kernel/ptrace_32.c

index 36f50ad81e83294a91516a02235a1df5bb733350..06f765d71a2951788ac825ff9bdc32ff0f1b7da9 100644 (file)
@@ -291,7 +291,7 @@ static const struct user_regset sh_regsets[] = {
         *      PC, PR, SR, GBR, MACH, MACL, TRA
         */
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS,
+               USER_REGSET_NOTE_TYPE(PRSTATUS),
                .n              = ELF_NGREG,
                .size           = sizeof(long),
                .align          = sizeof(long),
@@ -301,7 +301,7 @@ static const struct user_regset sh_regsets[] = {
 
 #ifdef CONFIG_SH_FPU
        [REGSET_FPU] = {
-               .core_note_type = NT_PRFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG),
                .n              = sizeof(struct user_fpu_struct) / sizeof(long),
                .size           = sizeof(long),
                .align          = sizeof(long),