Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Michael Petlan <mpetlan@redhat.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf build-id: Fix off-by-one bug when printing kernel/module build-id
Date: Wed, 20 May 2026 16:00:11 -0700	[thread overview]
Message-ID: <ag48-3abXn7ZGSSW@google.com> (raw)
In-Reply-To: <ag4CoMSo8MMLoeTM@x1>

On Wed, May 20, 2026 at 03:51:12PM -0300, Arnaldo Carvalho de Melo wrote:
> 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.

I sent out this a month ago, but forgot to ping for inclusion.

https://lore.kernel.org/linux-perf-users/20260420180858.129075-1-namhyung@kernel.org/

Anyway, I'm ok with fixing it either way.

Thanks,
Namhyung


      reply	other threads:[~2026-05-20 23:00 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
2026-05-20 23:00     ` Namhyung Kim [this message]

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