WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/libarena/include/asan.h', please use '/*' instead #31: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #31: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #43: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:13: +extern volatile u64 __asan_shadow_memory_dynamic_address; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #44: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:14: +extern volatile bool asan_reported; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #45: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:15: +extern volatile bool asan_inited; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #46: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:16: +extern volatile bool asan_report_once; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #47: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:17: +extern volatile bool asan_emit_stack; CHECK: Prefer using the BIT_ULL macro #52: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:22: +#define ASAN_SHADOW_SCALE (1ULL << ASAN_SHADOW_SHIFT) CHECK: spaces preferred around that '*' (ctx:WxV) #69: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:39: +s8a *mem_to_shadow(void __arena __arg_arena *addr) ^ WARNING: line length of 101 exceeds 80 columns #71: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:41: + return (s8a *)(((u32)(u64)addr >> ASAN_SHADOW_SHIFT) + __asan_shadow_memory_dynamic_address); CHECK: spaces preferred around that '*' (ctx:WxV) #78: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:48: +s8 asan_shadow_value(void __arena __arg_arena *addr) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #92: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:62: +int asan_poison(void __arena *addr, s8 val, size_t size); ^ CHECK: spaces preferred around that '*' (ctx:WxV) #93: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:63: +int asan_unpoison(void __arena *addr, size_t size); ^ CHECK: spaces preferred around that '*' (ctx:WxV) #94: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:64: +bool asan_shadow_set(void __arena *addr); ^ WARNING: macros should not use a trailing semicolon #101: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:71: +#define DECLARE_ASAN_LOAD_STORE_SIZE(size) \ + void __asan_store##size(void *addr); \ + void __asan_store##size##_noabort(void *addr); \ + void __asan_load##size(void *addr); \ + void __asan_load##size##_noabort(void *addr); \ + void __asan_report_store##size(void *addr); \ + void __asan_report_store##size##_noabort(void *addr); \ + void __asan_report_load##size(void *addr); \ + void __asan_report_load##size##_noabort(void *addr); ERROR: open brace '{' following function definitions go on the next line #136: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:106: +__weak __noasan +int asan_dummy_call(void) { ERROR: open brace '{' following function definitions go on the next line #137: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:107: +int asan_dummy_call(void) { WARNING: line length of 84 exceeds 80 columns #146: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:116: +static inline int asan_poison(void __arena *addr, s8 val, size_t size) { return 0; } CHECK: spaces preferred around that '*' (ctx:WxV) #146: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:116: +static inline int asan_poison(void __arena *addr, s8 val, size_t size) { return 0; } ^ CHECK: spaces preferred around that '*' (ctx:WxV) #147: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:117: +static inline int asan_unpoison(void __arena *addr, size_t size) { return 0; } ^ CHECK: spaces preferred around that '*' (ctx:WxV) #148: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:118: +static inline bool asan_shadow_set(void __arena *addr) { return 0; } ^ CHECK: spaces preferred around that '*' (ctx:WxV) #149: FILE: tools/testing/selftests/bpf/libarena/include/asan.h:119: +static inline s8 asan_shadow_value(void __arena *addr) { return 0; } ^ WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #163: FILE: tools/testing/selftests/bpf/libarena/include/common.h:42: +extern volatile u64 asan_violated; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #255: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:83: +volatile u64 asan_violated = 0; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #260: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:88: +volatile u64 __asan_shadow_memory_dynamic_address; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #262: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:90: +volatile bool asan_reported = false; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #263: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:91: +volatile bool asan_inited = false; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #268: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:96: +volatile bool asan_report_once = false; WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #269: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:97: +volatile bool asan_emit_stack = false; CHECK: spaces preferred around that '*' (ctx:WxV) #274: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:102: +__weak int asan_memset(s8a __arg_arena *dst, s8 val, size_t size) ^ WARNING: line length of 84 exceeds 80 columns #294: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:122: + * Byte is non-zero. Access is valid if granule offset in [0, shadow_value), CHECK: spaces preferred around that '*' (ctx:WxV) #325: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:153: +__weak bool asan_shadow_set(void __arena __arg_arena *addr) ^ CHECK: spaces preferred around that '*' (ctx:WxV) #360: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:188: +__weak int asan_report(s8a __arg_arena *addr, size_t sz, ^ CHECK: Alignment should match open parenthesis #361: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:189: +__weak int asan_report(s8a __arg_arena *addr, size_t sz, + bool write) WARNING: line length of 90 exceeds 80 columns #372: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:200: + arena_stderr("Memory violation for address %p (0x%lx) for %s of size %ld", CHECK: Alignment should match open parenthesis #373: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:201: + arena_stderr("Memory violation for address %p (0x%lx) for %s of size %ld", + addr, (u64)addr, write ? "write" : "read", sz); WARNING: Prefer 'fallthrough;' over fallthrough comment #401: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:229: + /* FALLTHROUGH */ ERROR: inline keyword should sit between storage class and type #449: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:277: + __hidden void __always_inline __asan_store##size##_noabort(void *addr) \ WARNING: please, no space before tabs #528: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:356: + * ^Ia) pulling memory from the arena segment using bpf_arena_alloc_pages()$ WARNING: please, no space before tabs #529: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:357: + * ^Ib) freeing memory from application code$ CHECK: spaces preferred around that '*' (ctx:WxV) #531: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:359: +__hidden __noasan int asan_poison(void __arena *addr, s8 val, size_t size) ^ WARNING: line length of 84 exceeds 80 columns #537: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:365: + * Poisoning from a non-granule address makes no sense: We can only allocate WARNING: line length of 81 exceeds 80 columns #538: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:366: + * memory to the application that has a granule-aligned starting address, WARNING: line length of 86 exceeds 80 columns #562: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:390: + * That would be possible if we could free unaligned regions, so prevent that. CHECK: spaces preferred around that '*' (ctx:WxV) #588: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:416: +__hidden __noasan int asan_unpoison(void __arena *addr, size_t size) ^ CHECK: spaces preferred around that '-' (ctx:WxV) #644: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:472: + if ((all_pages & ((1 << ASAN_SHADOW_SHIFT) -1 ))) ^ ERROR: space prohibited before that close parenthesis ')' #644: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:472: + if ((all_pages & ((1 << ASAN_SHADOW_SHIFT) -1 ))) WARNING: line length of 101 exceeds 80 columns #656: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:484: + arena_stderr("error: globals %lx do not fit in arena %lx", globals_pages, all_pages); WARNING: line length of 105 exceeds 80 columns #661: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:489: + arena_stderr("error: globals %lx do not leave room for shadow map %lx (arena pages %lx)", CHECK: Alignment should match open parenthesis #662: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:490: + arena_stderr("error: globals %lx do not leave room for shadow map %lx (arena pages %lx)", + globals_pages, shadow_pages, all_pages); WARNING: line length of 84 exceeds 80 columns #670: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:498: + * Allocate the last (1/ASAN_SHADOW_SCALE)th of an arena's pages for the map WARNING: line length of 88 exceeds 80 columns #673: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:501: + * The allocated map pages are zeroed out, meaning all memory is marked as valid WARNING: line length of 88 exceeds 80 columns #674: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:502: + * even if it's not allocated already. This is expected: Since the actual memory WARNING: line length of 87 exceeds 80 columns #675: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:503: + * pages are not allocated, accesses to it will trigger page faults and will be WARNING: line length of 90 exceeds 80 columns #676: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:504: + * reported through BPF streams. Any pages allocated through bpf_arena_alloc_pages CHECK: Lines should not end with a '(' #679: FILE: tools/testing/selftests/bpf/libarena/src/asan.bpf.c:507: + shadowmap = (u64)bpf_arena_alloc_pages( total: 4 errors, 32 warnings, 20 checks, 662 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 6aac536185f0 ("selftests/bpf: Add arena ASAN runtime to libarena") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.