[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9f18da33-7446-7237-91be-e52a274877d8@embeddedor.com>
Date: Wed, 23 Jun 2021 13:39:49 -0500
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: dsterba@...e.cz, Stephen Rothwell <sfr@...b.auug.org.au>,
Kees Cook <keescook@...omium.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: linux-next: build warning after merge of the kspp-gustavo tree
On 6/23/21 08:14, David Sterba wrote:
> 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.
Awesome. :)
Thanks, David.
--
Gustavo
Powered by blists - more mailing lists