From: Thorsten Blum <thorsten.blum@linux.dev>
To: Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.cz>,
Christian Brauner <brauner@kernel.org>,
NeilBrown <neil@brown.name>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: [PATCH RESEND] fs/xattr: Annotate struct simple_xattr with __counted_by
Date: Mon, 5 Jan 2026 13:20:53 +0100 [thread overview]
Message-ID: <20260105122057.2347-2-thorsten.blum@linux.dev> (raw)
Add the __counted_by() compiler attribute to the flexible array member
'value' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
include/linux/xattr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index 64e9afe7d647..296b5ee5c979 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -114,7 +114,7 @@ struct simple_xattr {
struct rb_node rb_node;
char *name;
size_t size;
- char value[];
+ char value[] __counted_by(size);
};
void simple_xattrs_init(struct simple_xattrs *xattrs);
--
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
next reply other threads:[~2026-01-05 12:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 12:20 Thorsten Blum [this message]
2026-01-12 22:30 ` [PATCH RESEND] fs/xattr: Annotate struct simple_xattr with __counted_by Kees Cook
-- strict thread matches above, loose matches on Subject: below --
2025-11-22 12:00 Thorsten Blum
2025-11-25 12:00 ` Jan Kara
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=20260105122057.2347-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=brauner@kernel.org \
--cc=gustavoars@kernel.org \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neil@brown.name \
/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