Linux Perf Users
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Michael Petlan <mpetlan@redhat.com>,
	linux-perf-users@vger.kernel.org, namhyung@kernel.org
Subject: Re: [PATCH] perf build-id: Fix off-by-one bug when printing kernel/module build-id
Date: Wed, 20 May 2026 15:51:12 -0300	[thread overview]
Message-ID: <ag4CoMSo8MMLoeTM@x1> (raw)
In-Reply-To: <CAP-5=fV=ouJST+4Aww9gHBLSyag0mZsXM+HWYGLQNd1T3oH0Rg@mail.gmail.com>

On Wed, May 20, 2026 at 08:55:51AM -0700, Ian Rogers wrote:
> On Tue, May 19, 2026 at 3:39 PM Michael Petlan <mpetlan@redhat.com> wrote:
> >
> > When changing sprintf functions to snprintf, one byte got lost. Since
> > snprintf ones do not handle the '\0' terminating character, the number
> > of printed characters is 40, while sizeof(sbuild_id) is 41, including
> > the terminating '\0' character. This makes the later check fail so that
> > nothing is printed.
> >
> > Fix that.
> >
> > Before:
> >     [Michael@Carbon ~]$ perf buildid-list -k
> >     [Michael@Carbon ~]$
> >
> > After:
> >     [Michael@Carbon ~]$ perf buildid-list -k
> >     a527806324d543c4bc3ff2f9c9519d494fed5f68
> >     [Michael@Carbon ~]$
> >
> > Fixes: fccaaf6fbbc5 ("perf build-id: Change sprintf functions to snprintf")
> >
> > Signed-off-by: Michael Petlan <mpetlan@redhat.com>
> 
> Tested-by: Ian Rogers <irogers@google.com>
> also Sashiko is green for this patch:
> https://sashiko.dev/#/patchset/20260519223855.191637-1-mpetlan%40redhat.com

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo

  reply	other threads:[~2026-05-20 18:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 22:38 [PATCH] perf build-id: Fix off-by-one bug when printing kernel/module build-id Michael Petlan
2026-05-20 15:55 ` Ian Rogers
2026-05-20 18:51   ` Arnaldo Carvalho de Melo [this message]
2026-05-20 23:00     ` Namhyung Kim

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=ag4CoMSo8MMLoeTM@x1 \
    --to=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    /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