[<prev] [next>] [day] [month] [year] [list]
Message-ID: <c883cccd53beb412f4806d28f48e8a3ddd4f0995.1716109606.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 19 May 2024 11:09:59 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Ilya Dryomov <idryomov@...il.com>,
Xiubo Li <xiubli@...hat.com>,
Kees Cook <keescook@...omium.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
ceph-devel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: [PATCH 2/2 net-next] libceph: Use __counted_by() in struct ceph_snap_context
Annotate the 'snaps' flexible array in "struct ceph_snap_context" with
__counted_by() so that additional checks can be made, if enabled.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Compile tested only
---
include/linux/ceph/libceph.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 4497d0a6772c..485efc8837d5 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -164,7 +164,7 @@ struct ceph_snap_context {
refcount_t nref;
u64 seq;
u32 num_snaps;
- u64 snaps[];
+ u64 snaps[] __counted_by(num_snaps);
};
extern struct ceph_snap_context *ceph_create_snap_context(u32 snap_count,
--
2.45.1
Powered by blists - more mailing lists