[Devel] [PATCH vz10] fs/fuse kio: convert _inline_buffer[0] to flexible array member

Konstantin Khorenko khorenko at virtuozzo.com
Mon Mar 23 16:14:00 MSK 2026


Zero-length arrays cause FORTIFY_SOURCE __write_overflow_field warnings
on every memcpy into _inline_buffer, because __builtin_object_size
returns 0 for [0] arrays. Converting to C99 flexible array members ([])
makes the size "unknown" to the compiler, silencing the false positives
in pcs_sock_io.c, pcs_rpc.c, pcs_cs.c and pcs_krpc.c.

Fixes: 923a394f288cc ("fuse kio: Add pcs engine combo v0.8")
https://virtuozzo.atlassian.net/browse/VSTOR-127512

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>

Feature: vStorage
---
 fs/fuse/kio/pcs/pcs_sock_io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_sock_io.h b/fs/fuse/kio/pcs/pcs_sock_io.h
index 422229fb3963d..d894aebdca7f5 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.h
+++ b/fs/fuse/kio/pcs/pcs_sock_io.h
@@ -84,7 +84,7 @@ struct pcs_msg
 	short		_inline_len;
 	struct kvec	_inline_kv;
 
-	char		_inline_buffer[0];
+	char		_inline_buffer[];
 };
 
 static inline void * pcs_msg_aligned_data(struct pcs_msg * msg, int offset)
@@ -157,7 +157,7 @@ struct pcs_sockio
 	void			(*write_wakeup)(struct pcs_sockio *);
 	struct rcu_head		rcu;
 
-	char			_inline_buffer[0];
+	char			_inline_buffer[];
 };
 
 void pcs_sk_data_ready(struct sock *sk);
-- 
2.43.0



More information about the Devel mailing list