Linux Perf Users
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: lv.yating@zte.com.cn, peterz@infradead.org, mingo@redhat.com,
	namhyung@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	adrian.hunter@intel.com, james.clark@linaro.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	liu.qingtao2@zte.com.cn, he.yilin@zte.com.cn,
	zhang.cheng35@zte.com.cn, ye.zhihao1@zte.com.cn,
	shen.lin1@zte.com.cn, dai.hualiang@zte.com.cn,
	stable@vger.kernel.org, hu.shengming@zte.com.cn
Subject: Re: [PATCH] perf machine: Fix NULL deref in thread__resolve_callchain_sample()
Date: Tue, 27 Oct 2026 17:37:29 -0300	[thread overview]
Message-ID: <auELiZHf3HldL5wQ@phoenix2> (raw)
In-Reply-To: <CAP-5=fUbpxz9HQV+BRd62Yk+mQ5Bq-G3XvcK8ea3W8E3BqM6jg@mail.gmail.com>

On Tue, Oct 27, 2026 at 08:21:16AM -0700, Ian Rogers wrote:
> On Tue, Oct 27, 2026 at 4:54 AM <lv.yating@zte.com.cn> wrote:
> > When recording with -j stack, resolve_lbr_callchain_sample() can
> > dereference a NULL 'chain' pointer while resolving the branch
> > stack.

> > $ perf record -j stack -e branches:u uname
> > perf: Segmentation fault

> > Fix it by checking 'chain' for NULL before dereferencing it.

> > Fixes: 29be60c93d2d ("perf build-id: Mark DSO in sample callchains")
> > Signed-off-by: lvyating <lv.yating@zte.com.cn>
> > Cc: stable@vger.kernel.org
 
> Tested-by: Ian Rogers <irogers@google.com>
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks, applied for v7.4.
 
> I wonder - this failure points to a lack of test coverage. For LBR the
> main coverage comes from:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/shell/record_lbr.sh?h=perf-tools-next
> Could you help expand the tests to avoid regressions?

That would be great indeed,

- Arnaldo

  reply	other threads:[~2026-10-27 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 11:47 [PATCH] perf machine: Fix NULL deref in thread__resolve_callchain_sample() lv.yating
2026-10-27 12:11 ` sashiko-bot
2026-10-27 15:21 ` Ian Rogers
2026-10-27 20:37   ` Arnaldo Carvalho de Melo [this message]
     [not found] <2026102719473296875zO7s1T904dguHCkN5vy@zte.com.cn>
2026-10-27 15:51 ` hu.shengming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auELiZHf3HldL5wQ@phoenix2 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dai.hualiang@zte.com.cn \
    --cc=he.yilin@zte.com.cn \
    --cc=hu.shengming@zte.com.cn \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=liu.qingtao2@zte.com.cn \
    --cc=lv.yating@zte.com.cn \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=shen.lin1@zte.com.cn \
    --cc=stable@vger.kernel.org \
    --cc=ye.zhihao1@zte.com.cn \
    --cc=zhang.cheng35@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox