Patch "perf symbols: Fix return incorrect build_id size in elf_read_build_id()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf symbols: Fix return incorrect build_id size in elf_read_build_id()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-symbols-fix-return-incorrect-build_id-size-in-e.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aed5aa48e69b028fcad747d4afef490569eed2b4
Author: Yang Jihong <yangjihong1@xxxxxxxxxx>
Date:   Thu Apr 27 01:28:41 2023 +0000

    perf symbols: Fix return incorrect build_id size in elf_read_build_id()
    
    [ Upstream commit 1511e4696acb715a4fe48be89e1e691daec91c0e ]
    
    In elf_read_build_id(), if gnu build_id is found, should return the size of
    the actually copied data. If descsz is greater thanBuild_ID_SIZE,
    write_buildid data access may occur.
    
    Fixes: be96ea8ffa788dcc ("perf symbols: Fix issue with binaries using 16-bytes buildids (v2)")
    Reported-by: Will Ochowicz <Will.Ochowicz@xxxxxxxxxxxx>
    Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
    Tested-by: Will Ochowicz <Will.Ochowicz@xxxxxxxxxxxx>
    Acked-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Leo Yan <leo.yan@xxxxxxxxxx>
    Cc: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Stephane Eranian <eranian@xxxxxxxxxx>
    Link: https://lore.kernel.org/lkml/CWLP265MB49702F7BA3D6D8F13E4B1A719C649@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/
    Link: https://lore.kernel.org/r/20230427012841.231729-1-yangjihong1@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 4fef8d6bc2255..73f890664be5e 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -546,7 +546,7 @@ static int elf_read_build_id(Elf *elf, void *bf, size_t size)
 				size_t sz = min(size, descsz);
 				memcpy(bf, ptr, sz);
 				memset(bf + sz, 0, size - sz);
-				err = descsz;
+				err = sz;
 				break;
 			}
 		}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux