From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Arnd Bergmann <arnd@arndb.de>, Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Amir Goldstein <amir73il@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fsnotify: avoid gcc-10 zero-length-bounds warning
Date: Tue, 5 May 2020 09:39:36 -0500 [thread overview]
Message-ID: <b287bb2f-28e2-7a41-e015-aa5a0cb3b5d7@embeddedor.com> (raw)
In-Reply-To: <20200505143028.1290686-1-arnd@arndb.de>
On 5/5/20 09:30, Arnd Bergmann wrote:
> gcc-10 warns about accesses into the f_handle[] zero-length array.
>
> fs/notify/fdinfo.c: In function 'show_mark_fhandle':
> fs/notify/fdinfo.c:66:47: error: array subscript 'i' is outside the bounds of an interior zero-length array 'unsigned char[0]' [-Werror=zero-length-bounds]
> 66 | seq_printf(m, "%02x", (int)f.handle.f_handle[i]);
> | ~~~~~~~~~~~~~~~~~^~~
> In file included from fs/notify/fdinfo.c:3:
> include/linux/fs.h:988:16: note: while referencing 'f_handle'
> 988 | unsigned char f_handle[0];
> | ^~~~~~~~
>
> This is solved by using a flexible array instead.
>
> Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Gustavo has done the same thing as part of a treewide change, but keeping
> this separate lets us backport it to stable kernels more easily later.
Arnd,
I wonder why would we need to backport these changes to -stable... merely
because of the use of a new version of GCC?
Thanks
--
Gustavo
next prev parent reply other threads:[~2020-05-05 14:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 14:30 [PATCH] fsnotify: avoid gcc-10 zero-length-bounds warning Arnd Bergmann
2020-05-05 14:39 ` Gustavo A. R. Silva [this message]
2020-05-05 15:00 ` Arnd Bergmann
2020-05-05 15:11 ` Gustavo A. R. Silva
2020-05-05 15:23 ` Arnd Bergmann
2020-05-05 16:58 ` Linus Torvalds
2020-05-07 8:01 ` David Laight
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=b287bb2f-28e2-7a41-e015-aa5a0cb3b5d7@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=arnd@arndb.de \
--cc=darrick.wong@oracle.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.