]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sparc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
authorDave Martin <Dave.Martin@arm.com>
Tue, 1 Jul 2025 13:56:12 +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: David S. Miller <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: sparclinux@vger.kernel.org
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250701135616.29630-20-Dave.Martin@arm.com
Signed-off-by: Kees Cook <kees@kernel.org>
arch/sparc/kernel/ptrace_32.c
arch/sparc/kernel/ptrace_64.c

index c273ccebea46a3e40146335999611e06c3c7efea..c56333975fb13cff1fe056427ec886927eb23bb1 100644 (file)
@@ -218,7 +218,7 @@ static const struct user_regset sparc32_regsets[] = {
         *      PSR, PC, nPC, Y, WIM, TBR
         */
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS,
+               USER_REGSET_NOTE_TYPE(PRSTATUS),
                .n = 38,
                .size = sizeof(u32), .align = sizeof(u32),
                .regset_get = genregs32_get, .set = genregs32_set
@@ -234,7 +234,7 @@ static const struct user_regset sparc32_regsets[] = {
         *      FPU QUEUE (64 32-bit ints)
         */
        [REGSET_FP] = {
-               .core_note_type = NT_PRFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG),
                .n = 99,
                .size = sizeof(u32), .align = sizeof(u32),
                .regset_get = fpregs32_get, .set = fpregs32_set
index 4deba5b6eddb5c9e1d9cfc90f4fdd5d6733c3ec8..9fc67fa9336fefcd12f89a0464bd055a0256e4bf 100644 (file)
@@ -420,7 +420,7 @@ static const struct user_regset sparc64_regsets[] = {
         *      TSTATE, TPC, TNPC, Y
         */
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS,
+               USER_REGSET_NOTE_TYPE(PRSTATUS),
                .n = 36,
                .size = sizeof(u64), .align = sizeof(u64),
                .regset_get = genregs64_get, .set = genregs64_set
@@ -432,7 +432,7 @@ static const struct user_regset sparc64_regsets[] = {
         *      FPRS
         */
        [REGSET_FP] = {
-               .core_note_type = NT_PRFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG),
                .n = 35,
                .size = sizeof(u64), .align = sizeof(u64),
                .regset_get = fpregs64_get, .set = fpregs64_set
@@ -750,7 +750,7 @@ static const struct user_regset sparc32_regsets[] = {
         *      PSR, PC, nPC, Y, WIM, TBR
         */
        [REGSET_GENERAL] = {
-               .core_note_type = NT_PRSTATUS,
+               USER_REGSET_NOTE_TYPE(PRSTATUS),
                .n = 38,
                .size = sizeof(u32), .align = sizeof(u32),
                .regset_get = genregs32_get, .set = genregs32_set
@@ -766,7 +766,7 @@ static const struct user_regset sparc32_regsets[] = {
         *      FPU QUEUE (64 32-bit ints)
         */
        [REGSET_FP] = {
-               .core_note_type = NT_PRFPREG,
+               USER_REGSET_NOTE_TYPE(PRFPREG),
                .n = 99,
                .size = sizeof(u32), .align = sizeof(u32),
                .regset_get = fpregs32_get, .set = fpregs32_set