All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Kees Cook <keescook@chromium.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build warning after merge of the kspp-gustavo tree
Date: Wed, 23 Jun 2021 15:14:55 +0200	[thread overview]
Message-ID: <20210623131455.GM28158@suse.cz> (raw)
In-Reply-To: <20210623083901.1d49d19d@canb.auug.org.au>

On Wed, Jun 23, 2021 at 08:39:01AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the kspp-gustavo tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> In file included from fs/btrfs/ctree.h:9,
>                  from fs/btrfs/struct-funcs.c:8:
> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>    80 |  token->kaddr = page_address(token->eb->pages[idx + 1]);  \
>       |                              ~~~~~~~~~~~~~~~~^~~~~~~~~

The warning is correct, on powerpc and 64k pages the array has only 1
item, ie. only index 0 is valid. The overflow won't happen in practice
though because of previous branch that would happen in 100% cases. The
code handles when some bytes cross 2 pages but on 64k pages it's all
just one page.

To allow the warning to be enabled globally we'll fix it, I'll let
Gustavo know once it's done.

  parent reply	other threads:[~2021-06-23 13:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 22:39 linux-next: build warning after merge of the kspp-gustavo tree Stephen Rothwell
2021-06-22 22:46 ` Gustavo A. R. Silva
2021-06-22 23:01   ` Gustavo A. R. Silva
2021-06-23  3:03     ` Stephen Rothwell
2021-06-23 13:14 ` David Sterba [this message]
2021-06-23 18:39   ` Gustavo A. R. Silva
2021-07-13  0:22 Stephen Rothwell
2021-07-13  1:10 ` Gustavo A. R. Silva
2021-07-13  2:39   ` Gustavo A. R. Silva
2021-09-29 23:53 Stephen Rothwell
2021-09-30  0:05 ` Gustavo A. R. Silva
2023-11-21 22:47 Stephen Rothwell
2023-11-21 23:07 ` Gustavo A. R. Silva
2023-11-21 23:19   ` Stephen Rothwell
2023-11-21 23:23     ` Gustavo A. R. Silva
2023-11-21 22:50 Stephen Rothwell
2023-11-21 23:19 ` Gustavo A. R. Silva

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=20210623131455.GM28158@suse.cz \
    --to=dsterba@suse.cz \
    --cc=gustavo@embeddedor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.