Skip to content
Commit d4145960 authored by James Clark's avatar James Clark Committed by Arnaldo Carvalho de Melo
Browse files

perf dso: Fix /proc/kcore access on 32 bit systems



Because _LARGEFILE64_SOURCE is set in perf, file offset sizes can be
64 bits. If a workflow needs to open /proc/kcore on a 32 bit system (for
example to decode Arm ETM kernel trace) then the size value will be
wrapped to 32 bits in the function file_size() at this line:

  dso->data.file_size = st.st_size;

Setting the file_size member to be u64 fixes the issue and allows
/proc/kcore to be opened.

Reported-by: default avatarDenis Nikitin <denik@chromium.org>
Signed-off-by: default avatarJames Clark <james.clark@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20211021112700.112499-1-james.clark@arm.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e277ac28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment