Open kees opened 2 years ago
v5.18, GCC 11 to GCC 12:
All:
$ grep warning: fedora36.log | wc -l
182
-Warray-bounds:
$ grep warning: fedora36.log | grep 'Warray-bounds' | wc -l
153
OpenSSL v3
$ grep warning: fedora36.log | grep 'Wdeprecated-declarations' | wc -l
14
Everything else:
$ grep warning: fedora36.log | grep -Ev 'W(array-bounds|deprecated-declarations)' | wc -l
15
v5.18, GCC 11 to GCC 12 (without UBSAN_SHIFT):
All:
$ grep warning: f36-no-shift.log | wc -l
177
-Warray-bounds:
$ grep warning: f36-no-shift.log | grep 'Warray-bounds' | wc -l
148
Not actually 5 fewer; 9 fewer, but 4 added:
$ diff -u <(grep warning: fedora36.log | sort) <(grep warning: f36-no-shift.log | sort) | diffstat
62 | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
Apparent false positives:
../arch/x86/kvm/emulate.c:254:27: warning: array subscript 32 is above array bounds of 'long unsigned int[17]' [-Warray-bounds]
../arch/x86/kvm/ioapic.c:213:33: warning: array subscript 32 is above array bounds of 'union kvm_ioapic_redirect_entry[24]' [-Warray-bounds]
../drivers/hwmon/lm85.c:1110:26: warning: array subscript [0, 31] is outside array bounds of 'struct lm85_autofan[3]' [-Warray-bounds]
../drivers/net/ipa/ipa_interrupt.c:196:27: warning: array subscript 30 is above array bounds of 'void (*[30])(struct ipa *, enum ipa_irq_id)' [-Warray-bounds]
../drivers/net/wireless/ath/ath9k/mac.c:373:22: warning: array subscript 32 is above array bounds of 'struct ath9k_tx_queue_info[10]' [-Warray-bounds]
../drivers/net/wireless/intel/iwlwifi/mvm/sta.c:1077:37: warning: array subscript -1 is below array bounds of 'struct iwl_mvm_tid_data[9]' [-Warray-bounds]
../kernel/sched/psi.c:730:38: warning: array subscript 32 is above array bounds of 'unsigned int[5]' [-Warray-bounds]
../kernel/sched/psi.c:730:38: warning: array subscript 32 is above array bounds of 'unsigned int[5]' [-Warray-bounds]
../sound/pci/lola/lola_pcm.c:567:64: warning: array subscript [0, 31] is outside array bounds of 'struct lola_stream[16]' [-Warray-bounds]
Masked warnings exposed?
../fs/crypto/fname.c:475:33: warning: array subscript 'struct fscrypt_nokey_name[0]' is partly outside array bounds of 'unsigned char[189]' [-Warray-bounds]
../fs/crypto/fname.c:475:33: warning: array subscript 'struct fscrypt_nokey_name[0]' is partly outside array bounds of 'unsigned char[189]' [-Warray-bounds]
../fs/crypto/fname.c:476:39: warning: array subscript 'struct fscrypt_nokey_name[0]' is partly outside array bounds of 'unsigned char[189]' [-Warray-bounds]
../fs/crypto/fname.c:476:39: warning: array subscript 'struct fscrypt_nokey_name[0]' is partly outside array bounds of 'unsigned char[189]' [-Warray-bounds]
There are a lot of new -Warray-bounds warnings with GCC 12. At least one subset is due to a GCC bug.
-fsanitize=shift
vs-Warray-bounds
: bug (fixed in GCC 13). These false positives can be ignored:--param=min-pagesize=0
to Makefile (see commit 8b202ee21839 and commit f0be87c42cbd)