]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
parisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
authorDave Martin <Dave.Martin@arm.com>
Tue, 1 Jul 2025 13:56:07 +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: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: linux-parisc@vger.kernel.org
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250701135616.29630-15-Dave.Martin@arm.com
Signed-off-by: Kees Cook <kees@kernel.org>
arch/parisc/kernel/ptrace.c

index ceb45f51d52e982832b2788f02382824b3d1fd38..8a17ab7e6e0b939d96b89d53e9d9eb70c369d72a 100644 (file)
@@ -562,12 +562,12 @@ static int gpr_set(struct task_struct *target,
 
 static const struct user_regset native_regsets[] = {
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
+               USER_REGSET_NOTE_TYPE(PRSTATUS), .n = ELF_NGREG,
                .size = sizeof(long), .align = sizeof(long),
                .regset_get = gpr_get, .set = gpr_set
        },
        [REGSET_FP] = {
-               .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG), .n = ELF_NFPREG,
                .size = sizeof(__u64), .align = sizeof(__u64),
                .regset_get = fpr_get, .set = fpr_set
        }
@@ -629,12 +629,12 @@ static int gpr32_set(struct task_struct *target,
  */
 static const struct user_regset compat_regsets[] = {
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
+               USER_REGSET_NOTE_TYPE(PRSTATUS), .n = ELF_NGREG,
                .size = sizeof(compat_long_t), .align = sizeof(compat_long_t),
                .regset_get = gpr32_get, .set = gpr32_set
        },
        [REGSET_FP] = {
-               .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG), .n = ELF_NFPREG,
                .size = sizeof(__u64), .align = sizeof(__u64),
                .regset_get = fpr_get, .set = fpr_set
        }