CC: [email protected] CC: [email protected] BCC: [email protected] CC: [email protected] TO: John Ogness <[email protected]> CC: Sebastian Andrzej Siewior <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.17.y-rt-rebase head: 2da1afeb004bf496c1cb9b5dbc9b92900a689b2b commit: 13ead04370ba6ef9a9067b71a805b24a1cfcd264 [16/117] serial: 8250: implement write_atomic :::::: branch date: 31 hours ago :::::: commit date: 31 hours ago config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220228/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?id=13ead04370ba6ef9a9067b71a805b24a1cfcd264 git remote add rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git git fetch --no-tags rt-devel linux-5.17.y-rt-rebase git checkout 13ead04370ba6ef9a9067b71a805b24a1cfcd264 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ include/linux/printk.h:435:3: note: expanded from macro 'printk_index_wrap' __printk_index_emit(_fmt, NULL, NULL); \ ^ include/linux/printk.h:388:3: note: expanded from macro '__printk_index_emit' if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \ ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ fs/gfs2/bmap.c:2279:2: note: '?' condition is true fs_warn(sdp, "bmap=%d lblock=%llu block=%llu, state=0x%08lx, size=%llu\n", ^ fs/gfs2/util.h:22:2: note: expanded from macro 'fs_warn' pr_warn("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__) ^ include/linux/printk.h:517:2: note: expanded from macro 'pr_warn' printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^ include/linux/printk.h:464:26: note: expanded from macro 'printk' #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) ^ include/linux/printk.h:435:3: note: expanded from macro 'printk_index_wrap' __printk_index_emit(_fmt, NULL, NULL); \ ^ include/linux/printk.h:397:12: note: expanded from macro '__printk_index_emit' .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \ ^ fs/gfs2/bmap.c:2279:2: note: '?' condition is true fs_warn(sdp, "bmap=%d lblock=%llu block=%llu, state=0x%08lx, size=%llu\n", ^ fs/gfs2/util.h:22:2: note: expanded from macro 'fs_warn' pr_warn("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__) ^ include/linux/printk.h:517:2: note: expanded from macro 'pr_warn' printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^ include/linux/printk.h:464:26: note: expanded from macro 'printk' #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) ^ include/linux/printk.h:435:3: note: expanded from macro 'printk_index_wrap' __printk_index_emit(_fmt, NULL, NULL); \ ^ include/linux/printk.h:401:14: note: expanded from macro '__printk_index_emit' .level = __builtin_constant_p(_level) ? (_level) : NULL, \ ^ fs/gfs2/bmap.c:2279:2: note: Loop condition is false. Exiting loop fs_warn(sdp, "bmap=%d lblock=%llu block=%llu, state=0x%08lx, size=%llu\n", ^ fs/gfs2/util.h:22:2: note: expanded from macro 'fs_warn' pr_warn("fsid=%s: " fmt, (fs)->sd_fsname, ##__VA_ARGS__) ^ include/linux/printk.h:517:2: note: expanded from macro 'pr_warn' printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^ include/linux/printk.h:464:26: note: expanded from macro 'printk' #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) ^ include/linux/printk.h:435:3: note: expanded from macro 'printk_index_wrap' __printk_index_emit(_fmt, NULL, NULL); \ ^ include/linux/printk.h:387:2: note: expanded from macro '__printk_index_emit' do { \ ^ fs/gfs2/bmap.c:2282:2: note: Calling 'gfs2_free_journal_extents' gfs2_free_journal_extents(jd); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/gfs2/bmap.c:2178:2: note: Loop condition is true. Entering loop body while(!list_empty(&jd->extent_list)) { ^ fs/gfs2/bmap.c:2181:3: note: Memory is released kfree(jext); ^~~~~~~~~~~ fs/gfs2/bmap.c:2178:8: note: Assuming the condition is true while(!list_empty(&jd->extent_list)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/gfs2/bmap.c:2178:2: note: Loop condition is true. Entering loop body while(!list_empty(&jd->extent_list)) { ^ fs/gfs2/bmap.c:2180:3: note: Calling 'list_del' list_del(&jext->list); ^~~~~~~~~~~~~~~~~~~~~ include/linux/list.h:149:14: note: Use of memory after it is freed entry->next = LIST_POISON1; ~~~~~~~~~~~ ^ 1 warning generated. Suppressed 1 warnings (1 with check filters). 4 warnings generated. kernel/printk/printk.c:157:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcpy(devkmsg_log_str, "on"); ^~~~~~ kernel/printk/printk.c:157:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 strcpy(devkmsg_log_str, "on"); ^~~~~~ kernel/printk/printk.c:159:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcpy(devkmsg_log_str, "off"); ^~~~~~ kernel/printk/printk.c:159:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 strcpy(devkmsg_log_str, "off"); ^~~~~~ >> kernel/printk/printk.c:3059:4: warning: Value stored to 'any_usable' is >> never read [clang-analyzer-deadcode.DeadStores] any_usable = true; ^ ~~~~ kernel/printk/printk.c:3059:4: note: Value stored to 'any_usable' is never read any_usable = true; ^ ~~~~ Suppressed 1 warnings (1 with check filters). 2 warnings generated. drivers/input/touchscreen/ads7846.c:329:8: warning: Excessive padding in 'struct ser_req' (81 padding bytes, where 17 is optimal). Optimal fields order: sample, scratch, msg, xfer, ref_on, command, ref_off, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding] struct ser_req { ~~~~~~~^~~~~~~~~ drivers/input/touchscreen/ads7846.c:329:8: note: Excessive padding in 'struct ser_req' (81 padding bytes, where 17 is optimal). Optimal fields order: sample, scratch, msg, xfer, ref_on, command, ref_off, consider reordering the fields or adding explicit padding members struct ser_req { ~~~~~~~^~~~~~~~~ drivers/input/touchscreen/ads7846.c:343:8: warning: Excessive padding in 'struct ads7845_ser_req' (114 padding bytes, where 50 is optimal). Optimal fields order: sample, command, msg, xfer, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding] struct ads7845_ser_req { ~~~~~~~^~~~~~~~~~~~~~~~~ drivers/input/touchscreen/ads7846.c:343:8: note: Excessive padding in 'struct ads7845_ser_req' (114 padding bytes, where 50 is optimal). Optimal fields order: sample, command, msg, xfer, consider reordering the fields or adding explicit padding members struct ads7845_ser_req { ~~~~~~~^~~~~~~~~~~~~~~~~ 1 warning generated. include/linux/list.h:88:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] __list_add(new, head, head->next); ^ kernel/audit_watch.c:476:19: note: Assuming 'audit_watch_group' is equal to field 'group' if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/asm-generic/bug.h:104:25: note: expanded from macro 'WARN_ON_ONCE' int __ret_warn_on = !!(condition); \ ^~~~~~~~~ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ kernel/audit_watch.c:476:6: note: '?' condition is false if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE' if (unlikely(__ret_warn_on)) \ ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ kernel/audit_watch.c:476:6: note: '?' condition is false if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE' if (unlikely(__ret_warn_on)) \ ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ kernel/audit_watch.c:476:6: note: Taking false branch if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE' if (unlikely(__ret_warn_on)) \ ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ kernel/audit_watch.c:476:2: note: '?' condition is false if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ kernel/audit_watch.c:476:19: note: Assuming 'audit_watch_group' is equal to field 'group' if (WARN_ON_ONCE(inode_mark->group != audit_watch_group)) ^ include/asm-generic/bug.h:104:25: note: expanded from macro 'WARN_ON_ONCE' int __ret_warn_on = !!(condition); \ vim +/any_usable +3059 kernel/printk/printk.c a1b245828d4e47 John Ogness 2022-02-04 3048 a1b245828d4e47 John Ogness 2022-02-04 3049 printk_cpu_sync_get_irqsave(flags); a1b245828d4e47 John Ogness 2022-02-04 3050 a1b245828d4e47 John Ogness 2022-02-04 3051 do { a1b245828d4e47 John Ogness 2022-02-04 3052 any_progress = false; a1b245828d4e47 John Ogness 2022-02-04 3053 a1b245828d4e47 John Ogness 2022-02-04 3054 for_each_console(con) { a1b245828d4e47 John Ogness 2022-02-04 3055 bool progress; a1b245828d4e47 John Ogness 2022-02-04 3056 a1b245828d4e47 John Ogness 2022-02-04 3057 if (!console_is_usable(con, true)) a1b245828d4e47 John Ogness 2022-02-04 3058 continue; a1b245828d4e47 John Ogness 2022-02-04 @3059 any_usable = true; a1b245828d4e47 John Ogness 2022-02-04 3060 a1b245828d4e47 John Ogness 2022-02-04 3061 if (con->flags & CON_EXTENDED) { a1b245828d4e47 John Ogness 2022-02-04 3062 /* Extended consoles do not print "dropped messages". */ a1b245828d4e47 John Ogness 2022-02-04 3063 progress = console_emit_next_record(con, a1b245828d4e47 John Ogness 2022-02-04 3064 &con->atomic_data->text[index], a1b245828d4e47 John Ogness 2022-02-04 3065 &con->atomic_data->ext_text[index], a1b245828d4e47 John Ogness 2022-02-04 3066 NULL, a1b245828d4e47 John Ogness 2022-02-04 3067 true, NULL); a1b245828d4e47 John Ogness 2022-02-04 3068 } else { a1b245828d4e47 John Ogness 2022-02-04 3069 progress = console_emit_next_record(con, a1b245828d4e47 John Ogness 2022-02-04 3070 &con->atomic_data->text[index], a1b245828d4e47 John Ogness 2022-02-04 3071 NULL, a1b245828d4e47 John Ogness 2022-02-04 3072 &con->atomic_data->dropped_text[index], a1b245828d4e47 John Ogness 2022-02-04 3073 true, NULL); a1b245828d4e47 John Ogness 2022-02-04 3074 } a1b245828d4e47 John Ogness 2022-02-04 3075 a1b245828d4e47 John Ogness 2022-02-04 3076 if (!progress) a1b245828d4e47 John Ogness 2022-02-04 3077 continue; a1b245828d4e47 John Ogness 2022-02-04 3078 any_progress = true; a1b245828d4e47 John Ogness 2022-02-04 3079 a1b245828d4e47 John Ogness 2022-02-04 3080 touch_softlockup_watchdog_sync(); a1b245828d4e47 John Ogness 2022-02-04 3081 clocksource_touch_watchdog(); a1b245828d4e47 John Ogness 2022-02-04 3082 rcu_cpu_stall_reset(); a1b245828d4e47 John Ogness 2022-02-04 3083 touch_nmi_watchdog(); a1b245828d4e47 John Ogness 2022-02-04 3084 } a1b245828d4e47 John Ogness 2022-02-04 3085 } while (any_progress); a1b245828d4e47 John Ogness 2022-02-04 3086 a1b245828d4e47 John Ogness 2022-02-04 3087 printk_cpu_sync_put_irqrestore(flags); a1b245828d4e47 John Ogness 2022-02-04 3088 } a1b245828d4e47 John Ogness 2022-02-04 3089 #else /* CONFIG_HAVE_ATOMIC_CONSOLE */ a1b245828d4e47 John Ogness 2022-02-04 3090 #define atomic_console_flush_all() a1b245828d4e47 John Ogness 2022-02-04 3091 #endif a1b245828d4e47 John Ogness 2022-02-04 3092 :::::: The code at line 3059 was first introduced by commit :::::: a1b245828d4e478367d866406e847baf596e9673 printk: add infrastucture for atomic consoles :::::: TO: John Ogness <[email protected]> :::::: CC: Sebastian Andrzej Siewior <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
