lkml.org 
[lkml]   [2022]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] perf record: Fix a segfault in record__read_lost_samples()
On Fri, Sep 23, 2022 at 10:31:39AM -0700, Namhyung Kim wrote:
> When it fails to open events record__open() returns without setting the
> session->evlist. Then it gets a segfault in the function trying to read
> lost sample counts. You can easily reproduce it as a normal user like:
>
> $ perf record -p 1 true
> ...
> perf: Segmentation fault
> ...
>
> Skip the function if it has no evlist. And add more protection for evsels
> which are not properly initialized.
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Tested-by: Leo Yan <leo.yan@linaro.org>

\
 
 \ /
  Last update: 2022-09-25 03:09    [W:0.103 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site