From: Kees Cook <kees@kernel.org>
To: David Sterba <dsterba@suse.com>
Cc: Kees Cook <kees@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: [PATCH] fs/affs: struct affs_head: Replace 1-element array with flexible array
Date: Wed, 10 Jul 2024 15:57:09 -0700 [thread overview]
Message-ID: <20240710225709.work.175-kees@kernel.org> (raw)
AFFS uses struct affs_head's "table" array as a flexible array. Switch
this to a proper flexible array[1]. There are no sizeof() uses; struct
affs_head is only ever uses via direct casts. No binary output
differences were found after this change.
Link: https://github.com/KSPP/linux/issues/79 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
---
Cc: David Sterba <dsterba@suse.com>
Cc: linux-fsdevel@vger.kernel.org
---
fs/affs/amigaffs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/affs/amigaffs.h b/fs/affs/amigaffs.h
index 5509fbc98bc0..09dc23a644df 100644
--- a/fs/affs/amigaffs.h
+++ b/fs/affs/amigaffs.h
@@ -80,7 +80,7 @@ struct affs_head {
__be32 spare1;
__be32 first_data;
__be32 checksum;
- __be32 table[1];
+ __be32 table[];
};
struct affs_tail {
--
2.34.1
next reply other threads:[~2024-07-10 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 22:57 Kees Cook [this message]
2024-07-10 23:26 ` [PATCH] fs/affs: struct affs_head: Replace 1-element array with flexible array 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=20240710225709.work.175-kees@kernel.org \
--to=kees@kernel.org \
--cc=dsterba@suse.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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