]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/crash: Use note name macros
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Wed, 15 Jan 2025 05:48:00 +0000 (14:48 +0900)
committerKees Cook <kees@kernel.org>
Tue, 11 Feb 2025 00:56:54 +0000 (16:56 -0800)
Use note name macros to match with the userspace's expectation.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Link: https://lore.kernel.org/r/20250115-elf-v5-3-0f9e55bbb2fc@daynix.com
Signed-off-by: Kees Cook <kees@kernel.org>
arch/powerpc/kernel/fadump.c
arch/powerpc/platforms/powernv/opal-core.c

index 4b371c738213c9399dbb5d2f809a0374bba9ca85..d44349fe8e2b5348f56df181390f1a0462955545 100644 (file)
@@ -751,7 +751,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
         * prstatus.pr_pid = ????
         */
        elf_core_copy_regs(&prstatus.pr_reg, regs);
-       buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
+       buf = append_elf_note(buf, NN_PRSTATUS, NT_PRSTATUS,
                              &prstatus, sizeof(prstatus));
        return buf;
 }
index c9a9b759cc928b931a0ac18f7ed7469a6ecd52b5..a379ff86c12019808f7fc4d2ffd8645688bf1ff1 100644 (file)
@@ -149,7 +149,7 @@ static Elf64_Word *__init auxv_to_elf64_notes(Elf64_Word *buf,
        /* end of vector */
        bufp[idx++] = cpu_to_be64(AT_NULL);
 
-       buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_AUXV,
+       buf = append_elf64_note(buf, NN_AUXV, NT_AUXV,
                                oc_conf->auxv_buf, AUXV_DESC_SZ);
        return buf;
 }
@@ -252,7 +252,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf)
         * crashing CPU's prstatus.
         */
        first_cpu_note = buf;
-       buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
+       buf = append_elf64_note(buf, NN_PRSTATUS, NT_PRSTATUS,
                                &prstatus, sizeof(prstatus));
 
        for (i = 0; i < oc_conf->num_cpus; i++, bufp += size_per_thread) {
@@ -279,7 +279,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf)
                fill_prstatus(&prstatus, thread_pir, &regs);
 
                if (thread_pir != oc_conf->crashing_cpu) {
-                       buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME,
+                       buf = append_elf64_note(buf, NN_PRSTATUS,
                                                NT_PRSTATUS, &prstatus,
                                                sizeof(prstatus));
                } else {
@@ -287,7 +287,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf)
                         * Add crashing CPU as the first NT_PRSTATUS note for
                         * GDB to process the core file appropriately.
                         */
-                       append_elf64_note(first_cpu_note, CRASH_CORE_NOTE_NAME,
+                       append_elf64_note(first_cpu_note, NN_PRSTATUS,
                                          NT_PRSTATUS, &prstatus,
                                          sizeof(prstatus));
                }