ok: unsafe memchr() usage correctly detected with '__read_overflow' in lib/test_fortify/read_overflow-memchr.c lib/test_fortify/test_fortify.h: In function 'do_fortify_tests': lib/test_fortify/read_overflow-memchr.c:3:9: error: statement with no effect [-Werror=unused-value] 3 | memchr(small, 0x7A, sizeof(small) + 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/test_fortify/test_fortify.h:34:9: note: in expansion of macro 'TEST' 34 | TEST; | ^~~~ In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow-memchr.c:5: In function 'memchr', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:724:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter) 724 | __read_overflow(); | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memchr_inv() usage correctly detected with '__read_overflow' in lib/test_fortify/read_overflow-memchr_inv.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow-memchr_inv.c:5: In function 'memchr_inv', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:736:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter) 736 | __read_overflow(); | ^~~~~~~~~~~~~~~~~ ok: unsafe memcmp() usage correctly detected with '__read_overflow' in lib/test_fortify/read_overflow-memcmp.c lib/test_fortify/test_fortify.h: In function 'do_fortify_tests': lib/test_fortify/read_overflow-memcmp.c:3:9: error: statement with no effect [-Werror=unused-value] 3 | memcmp(small, large, sizeof(small) + 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/test_fortify/test_fortify.h:34:9: note: in expansion of macro 'TEST' 34 | TEST; | ^~~~ In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow-memcmp.c:5: In function 'memcmp', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:707:25: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter) 707 | __read_overflow(); | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memscan() usage correctly detected with '__read_overflow' in lib/test_fortify/read_overflow-memscan.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow-memscan.c:5: In function 'memscan', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:693:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter) 693 | __read_overflow(); | ^~~~~~~~~~~~~~~~~ ok: unsafe memcmp() usage correctly detected with '__read_overflow2' in lib/test_fortify/read_overflow2-memcmp.c lib/test_fortify/test_fortify.h: In function 'do_fortify_tests': lib/test_fortify/read_overflow2-memcmp.c:3:9: error: statement with no effect [-Werror=unused-value] 3 | memcmp(large, small, sizeof(small) + 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/test_fortify/test_fortify.h:34:9: note: in expansion of macro 'TEST' 34 | TEST; | ^~~~ In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow2-memcmp.c:5: In function 'memcmp', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:709:25: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object (2nd parameter) 709 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memcpy() usage correctly detected with '__read_overflow2' in lib/test_fortify/read_overflow2-memcpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow2-memcpy.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:567:25: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object (2nd parameter) 567 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ ./include/linux/fortify-string.h:580:25: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 580 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memmove() usage correctly detected with '__read_overflow2' in lib/test_fortify/read_overflow2-memmove.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow2-memmove.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:567:25: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object (2nd parameter) 567 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ ./include/linux/fortify-string.h:580:25: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 580 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memcpy() usage correctly detected with '__read_overflow2_field' in lib/test_fortify/read_overflow2_field-memcpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow2_field-memcpy.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:580:25: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 580 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memmove() usage correctly detected with '__read_overflow2_field' in lib/test_fortify/read_overflow2_field-memmove.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/read_overflow2_field-memmove.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:580:25: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] 580 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memcpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-memcpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-memcpy.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:564:25: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 564 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ./include/linux/fortify-string.h:571:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 571 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memmove() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-memmove.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-memmove.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:564:25: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 564 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ./include/linux/fortify-string.h:571:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 571 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memset() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-memset.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-memset.c:5: In function 'fortify_memset_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:476:25: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 476 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ./include/linux/fortify-string.h:480:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe strcpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-strcpy-lit.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-strcpy-lit.c:5: In function 'strcpy', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:787:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 787 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ok: unsafe strcpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-strcpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-strcpy.c:5: In function 'strcpy', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:787:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 787 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ok: unsafe strncpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-strncpy-src.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-strncpy-src.c:5: In function 'strncpy', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:202:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 202 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ok: unsafe strncpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-strncpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-strncpy.c:5: In function 'strncpy', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:202:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 202 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ok: unsafe strscpy() usage correctly detected with '__write_overflow' in lib/test_fortify/write_overflow-strscpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow-strscpy.c:5: In function 'sized_strscpy', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:293:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter) 293 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ ok: unsafe memcpy() usage correctly detected with '__write_overflow_field' in lib/test_fortify/write_overflow_field-memcpy.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow_field-memcpy.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:571:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 571 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memmove() usage correctly detected with '__write_overflow_field' in lib/test_fortify/write_overflow_field-memmove.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow_field-memmove.c:5: In function 'fortify_memcpy_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:571:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 571 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ok: unsafe memset() usage correctly detected with '__write_overflow_field' in lib/test_fortify/write_overflow_field-memset.c In file included from ./include/linux/string.h:374, from ./include/linux/bitmap.h:13, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:21, from ./arch/x86/include/asm/irqflags.h:80, from ./include/linux/irqflags.h:18, from ./include/linux/spinlock.h:59, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from lib/test_fortify/test_fortify.h:4, from lib/test_fortify/write_overflow_field-memset.c:5: In function 'fortify_memset_chk', inlined from 'do_fortify_tests' at lib/test_fortify/test_fortify.h:34:2: ./include/linux/fortify-string.h:480:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 480 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors