]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jan 2024 10:46:55 +0000 (11:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jan 2024 10:46:55 +0000 (11:46 +0100)
added patches:
perf-inject-fix-gen_elf_text_offset-for-jit.patch

queue-5.15/perf-inject-fix-gen_elf_text_offset-for-jit.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/perf-inject-fix-gen_elf_text_offset-for-jit.patch b/queue-5.15/perf-inject-fix-gen_elf_text_offset-for-jit.patch
new file mode 100644 (file)
index 0000000..3874ab2
--- /dev/null
@@ -0,0 +1,49 @@
+From 89b15d00527b7825ff19130ed83478e80e3fae99 Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Fri, 14 Oct 2022 20:09:04 +0300
+Subject: perf inject: Fix GEN_ELF_TEXT_OFFSET for jit
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+commit 89b15d00527b7825ff19130ed83478e80e3fae99 upstream.
+
+When a program header was added, it moved the text section but
+GEN_ELF_TEXT_OFFSET was not updated.
+
+Fix by adding the program header size and aligning.
+
+Fixes: babd04386b1df8c3 ("perf jit: Include program header in ELF files")
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Ian Rogers <irogers@google.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Lieven Hey <lieven.hey@kdab.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Link: https://lore.kernel.org/r/20221014170905.64069-7-adrian.hunter@intel.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+[namhyung: use "linux/kernel.h" instead to avoid build failure]
+Signed-off-by: Namhyung Kim <namhyung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/perf/util/genelf.h |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/tools/perf/util/genelf.h
++++ b/tools/perf/util/genelf.h
+@@ -2,6 +2,8 @@
+ #ifndef __GENELF_H__
+ #define __GENELF_H__
++#include <linux/kernel.h>
++
+ /* genelf.c */
+ int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
+                 const void *code, int csize, void *debug, int nr_debug_entries,
+@@ -73,6 +75,6 @@ int jit_add_debug_info(Elf *e, uint64_t
+ #endif
+ /* The .text section is directly after the ELF header */
+-#define GEN_ELF_TEXT_OFFSET sizeof(Elf_Ehdr)
++#define GEN_ELF_TEXT_OFFSET round_up(sizeof(Elf_Ehdr) + sizeof(Elf_Phdr), 16)
+ #endif
index 1139786f0232b33e10d1fe34941c1212d477ed0e..0974b511249f9ae6aaa33856d8da7464d22664e2 100644 (file)
@@ -51,3 +51,4 @@ mmc-core-cancel-delayed-work-before-releasing-host.patch
 mmc-sdhci-sprd-fix-emmc-init-failure-after-hw-reset.patch
 net-tls-update-curr-on-splice-as-well.patch
 ipv6-remove-max_size-check-inline-with-ipv4.patch
+perf-inject-fix-gen_elf_text_offset-for-jit.patch