Skip to content

Commit 40d3a88

Browse files
Dave Martinkees
authored andcommitted
um: 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: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Kees Cook <kees@kernel.org> Cc: Akihiko Odaki <akihiko.odaki@daynix.com> Cc: linux-um@lists.infradead.org Cc: x86@kernel.org Acked-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Link: https://lore.kernel.org/r/20250701135616.29630-22-Dave.Martin@arm.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 3de0414 commit 40d3a88

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

arch/x86/um/ptrace.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int generic_fpregs_set(struct task_struct *target,
236236

237237
static struct user_regset uml_regsets[] __ro_after_init = {
238238
[REGSET_GENERAL] = {
239-
.core_note_type = NT_PRSTATUS,
239+
USER_REGSET_NOTE_TYPE(PRSTATUS),
240240
.n = sizeof(struct user_regs_struct) / sizeof(long),
241241
.size = sizeof(long),
242242
.align = sizeof(long),
@@ -246,7 +246,7 @@ static struct user_regset uml_regsets[] __ro_after_init = {
246246
#ifdef CONFIG_X86_32
247247
/* Old FP registers, they are needed in signal frames */
248248
[REGSET_FP_LEGACY] = {
249-
.core_note_type = NT_PRFPREG,
249+
USER_REGSET_NOTE_TYPE(PRFPREG),
250250
.n = sizeof(struct user_i387_ia32_struct) / sizeof(long),
251251
.size = sizeof(long),
252252
.align = sizeof(long),
@@ -257,10 +257,10 @@ static struct user_regset uml_regsets[] __ro_after_init = {
257257
#endif
258258
[REGSET_FP] = {
259259
#ifdef CONFIG_X86_32
260-
.core_note_type = NT_PRXFPREG,
260+
USER_REGSET_NOTE_TYPE(PRXFPREG),
261261
.n = sizeof(struct user32_fxsr_struct) / sizeof(long),
262262
#else
263-
.core_note_type = NT_PRFPREG,
263+
USER_REGSET_NOTE_TYPE(PRFPREG),
264264
.n = sizeof(struct user_i387_struct) / sizeof(long),
265265
#endif
266266
.size = sizeof(long),
@@ -270,7 +270,7 @@ static struct user_regset uml_regsets[] __ro_after_init = {
270270
.set = generic_fpregs_set,
271271
},
272272
[REGSET_XSTATE] = {
273-
.core_note_type = NT_X86_XSTATE,
273+
USER_REGSET_NOTE_TYPE(X86_XSTATE),
274274
.size = sizeof(long),
275275
.align = sizeof(long),
276276
.active = generic_fpregs_active,

0 commit comments

Comments
 (0)