mirror of
https://github.com/torvalds/linux.git
synced 2026-10-05 11:24:03 +02:00
gcc has a bug with -ftrivial-auto-var-init=pattern that produces a
warning for correct code that uses sparse bitfields:
security/landlock/fs.c: In function 'is_access_to_paths_allowed.isra':
security/landlock/fs.c:767:28: error: '_layer_masks_child1' is used uninitialized [-Werror=uninitialized]
767 | struct layer_masks _layer_masks_child1, _layer_masks_child2;
| ^~~~~~~~~~~~~~~~~~~
security/landlock/fs.c:767:28: note: '_layer_masks_child1' declared here
767 | struct layer_masks _layer_masks_child1, _layer_masks_child2;
| ^~~~~~~~~~~~~~~~~~~
security/landlock/fs.c: In function 'hook_unix_find':
security/landlock/fs.c:1649:28: error: 'layer_masks' is used uninitialized [-Werror=uninitialized]
1649 | struct layer_masks layer_masks;
| ^~~~~~~~~~~
security/landlock/fs.c:1649:28: note: 'layer_masks' declared here
1649 | struct layer_masks layer_masks;
| ^~~~~~~~~~~
To work around this, change the definition of struct layer_mask to
use an explictit padding field.
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110743
Link: https://lore.kernel.org/all/20260619082133.3504146-1-arnd@kernel.org/
Fixes:
|
||
|---|---|---|
| .. | ||
| errata | ||
| .kunitconfig | ||
| access.h | ||
| audit.c | ||
| audit.h | ||
| common.h | ||
| cred.c | ||
| cred.h | ||
| domain.c | ||
| domain.h | ||
| errata.h | ||
| fs.c | ||
| fs.h | ||
| id.c | ||
| id.h | ||
| Kconfig | ||
| limits.h | ||
| log.c | ||
| log.h | ||
| Makefile | ||
| net.c | ||
| net.h | ||
| object.c | ||
| object.h | ||
| ruleset.c | ||
| ruleset.h | ||
| setup.c | ||
| setup.h | ||
| syscalls.c | ||
| task.c | ||
| task.h | ||
| trace.c | ||
| trace.h | ||
| tsync.c | ||
| tsync.h | ||