Skip to contentSkip to conversation

ext4: Annotate struct fname with __counted_by()

PATCH Applied Thorsten Blum 2 participants 3 messages Nov 5, 2024 – Nov 14, 2024 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ext4: Annotate struct fname with __counted_by()

Add the __counted_by compiler attribute to the flexible array member name to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

---
Changes in v2:
- Split the patch into two separate patches as suggested by Greg KH
- Link to v1: https://lore.kernel.org/r/[email protected]/

---
 fs/ext4/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/dir.c +1 -1
index ef6a3c8f3a9a..233479647f1b 100644
@@ -418,7 +418,7 @@ struct fname {
 	__u32		inode;
 	__u8		name_len;
 	__u8		file_type;
-	char		name[];
+	char		name[] __counted_by(name_len);
 };
 
 /*
Signature · 1 line
2.47.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Thorsten Blum

Add the __counted_by compiler attribute to the flexible array member name to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

Applied, thanks!

[1/1] ext4: Annotate struct fname with __counted_by()

      commit: de183b2baf90f0acc1854a3998c14b8b228f9643

By the way, in general, you don't need to resend patches unless you need to rebase them to fix patch conflicts; I track requested patches using patchwork, and I tend to process and review patches in batches.

If you are concerned that I might have missed a patch, feel free to reply to the original patch with a ping. I'll see it in my inbox, and even if it had gotten lost in my inbox, I can find the original patch using lore.kernel.org or patchwork.

Thanks!

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>
#2 lore raw
Quoted 8 lines · Theodore Ts'o

By the way, in general, you don't need to resend patches unless you need to rebase them to fix patch conflicts; I track requested patches using patchwork, and I tend to process and review patches in batches.

If you are concerned that I might have missed a patch, feel free to reply to the original patch with a ping. I'll see it in my inbox, and even if it had gotten lost in my inbox, I can find the original patch using lore.kernel.org or patchwork.

Thanks for letting me know.

Best regards,
Thorsten