Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fuse: quiet down complaints in fuse_conn_limit_write

gcc 15 complains about an uninitialized variable val that is passed by
reference into fuse_conn_limit_write:

control.c: In function ‘fuse_conn_congestion_threshold_write’:
include/asm-generic/rwonce.h:55:37: warning: ‘val’ may be used uninitialized [-Wmaybe-uninitialized]
55 | *(volatile typeof(x) *)&(x) = (val); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
include/asm-generic/rwonce.h:61:9: note: in expansion of macro ‘__WRITE_ONCE’
61 | __WRITE_ONCE(x, val); \
| ^~~~~~~~~~~~
control.c:178:9: note: in expansion of macro ‘WRITE_ONCE’
178 | WRITE_ONCE(fc->congestion_threshold, val);
| ^~~~~~~~~~
control.c:166:18: note: ‘val’ was declared here
166 | unsigned val;
| ^~~

Unfortunately there's enough macro spew involved in kstrtoul_from_user
that I think gcc gives up on its analysis and sprays the above warning.
AFAICT it's not actually a bug, but we could just zero-initialize the
variable to enable using -Wmaybe-uninitialized to find real problems.

Previously we would use some weird uninitialized_var annotation to quiet
down the warnings, so clearly this code has been like this for quite
some time.

Cc: stable@vger.kernel.org # v5.9
Fixes: 3f649ab728cda8 ("treewide: Remove uninitialized_var() usage")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

authored by

Darrick J. Wong and committed by
Miklos Szeredi
129a45f9 f595dda9

+2 -2
+2 -2
fs/fuse/control.c
··· 121 121 const char __user *buf, 122 122 size_t count, loff_t *ppos) 123 123 { 124 - unsigned val; 124 + unsigned int val = 0; 125 125 ssize_t ret; 126 126 127 127 ret = fuse_conn_limit_write(file, buf, count, ppos, &val, ··· 163 163 const char __user *buf, 164 164 size_t count, loff_t *ppos) 165 165 { 166 - unsigned val; 166 + unsigned int val = 0; 167 167 struct fuse_conn *fc; 168 168 ssize_t ret; 169 169