All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Dan Carpenter <error27@gmail.com>
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [bug report] ring-buffer: Introduce ring-buffer remotes
Date: Fri, 10 Apr 2026 13:46:46 +0100	[thread overview]
Message-ID: <adjxNnzgRleH3ll5@google.com> (raw)
In-Reply-To: <adjN-1ydA_kPPhmG@stanley.mountain>

On Fri, Apr 10, 2026 at 01:16:27PM +0300, Dan Carpenter wrote:
> Hello Vincent Donnefort,
> 
> Commit 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
> from Mar 9, 2026 (linux-next), leads to the following Smatch static
> checker warning:
> 
> 	kernel/trace/ring_buffer.c:2243 ring_buffer_desc_page()
> 	warn: array off by one? 'desc->page_va[page_id]'
> 
> kernel/trace/ring_buffer.c
>     2241 static void *ring_buffer_desc_page(struct ring_buffer_desc *desc, int page_id)
>     2242 {
> --> 2243         return page_id > desc->nr_page_va ? NULL : (void *)desc->page_va[page_id];
>                                 ^
> Based on the len = struct_size(desc, page_va, desc->nr_page_va), in
> ring_buffer_desc(), I'm pretty sure this should be >= instead of >.

You are right. Thanks for the report, I have sent a fix.

> 
>     2244 }
> 
> This email is a free service from the Smatch-CI project [smatch.sf.net].
> 
> regards,
> dan carpenter

      reply	other threads:[~2026-04-10 12:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 10:16 [bug report] ring-buffer: Introduce ring-buffer remotes Dan Carpenter
2026-04-10 12:46 ` Vincent Donnefort [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=adjxNnzgRleH3ll5@google.com \
    --to=vdonnefort@google.com \
    --cc=error27@gmail.com \
    --cc=linux-trace-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.