* [PATCH] libceph: Annotate crush_rule::steps with __counted_by()
@ 2026-11-03 16:22 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-03 16:22 UTC (permalink / raw)
To: Ilya Dryomov, Alex Markuze, Xiubo Li, Viacheslav Dubeyko,
Kees Cook, Gustavo A. R. Silva
Cc: Thorsten Blum, ceph-devel, linux-kernel, linux-hardening
Add __counted_by() to crush_rule::steps to improve access bounds
checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
include/linux/crush/crush.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 30dba392b730..7d243b9b1093 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -87,7 +87,7 @@ struct crush_rule_mask {
struct crush_rule {
__u32 len;
struct crush_rule_mask mask;
- struct crush_rule_step steps[];
+ struct crush_rule_step steps[] __counted_by(len);
};
#define crush_rule_size(len) (sizeof(struct crush_rule) + \
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-03 16:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 16:22 [PATCH] libceph: Annotate crush_rule::steps with __counted_by() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®