From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Thorsten Blum <thorsten.blum@toblux.com>,
viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
kees@kernel.org, gustavoars@kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] fs/select: Annotate struct poll_list with __counted_by()
Date: Thu, 8 Aug 2024 09:11:04 -0600 [thread overview]
Message-ID: <481a0b09-2e6f-4076-8e03-6205bae31f59@embeddedor.com> (raw)
In-Reply-To: <20240808150023.72578-2-thorsten.blum@toblux.com>
On 08/08/24 09:00, Thorsten Blum wrote:
> Add the __counted_by compiler attribute to the flexible array member
> entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Thanks
--
Gustavo
> ---
> fs/select.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/select.c b/fs/select.c
> index 9515c3fa1a03..1a4849e2afb9 100644
> --- a/fs/select.c
> +++ b/fs/select.c
> @@ -840,7 +840,7 @@ SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg)
> struct poll_list {
> struct poll_list *next;
> unsigned int len;
> - struct pollfd entries[];
> + struct pollfd entries[] __counted_by(len);
> };
>
> #define POLLFD_PER_PAGE ((PAGE_SIZE-sizeof(struct poll_list)) / sizeof(struct pollfd))
next prev parent reply other threads:[~2024-08-08 15:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 15:00 [PATCH] fs/select: Annotate struct poll_list with __counted_by() Thorsten Blum
2024-08-08 15:11 ` Gustavo A. R. Silva [this message]
2024-08-09 8:33 ` Christian Brauner
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=481a0b09-2e6f-4076-8e03-6205bae31f59@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=brauner@kernel.org \
--cc=gustavoars@kernel.org \
--cc=jack@suse.cz \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thorsten.blum@toblux.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).