tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: d51fb86ce6a3a3e59d7cba58738b63903b8cb37c commit: 9d423ac5414e69a36e95dc0b77392429c507cbe1 [2601/2601] gcc-plugins: simplify GCC plugin-dev capability test config: x86_64-randconfig-101-20241228 (https://download.01.org/0day-ci/archive/20250103/202501031923.x0AUCg7R-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202501031923.x0AUCg7R-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
kernel/stackleak.c:42:5-10: opportunity for str_enabled_disabled(state)
vim +42 kernel/stackleak.c
964c9dff009189 Alexander Popov 2018-08-17 21 964c9dff009189 Alexander Popov 2018-08-17 22 int stack_erasing_sysctl(struct ctl_table *table, int write, 4773ef33fc6e59 Tobias Klauser 2020-09-18 23 void *buffer, size_t *lenp, loff_t *ppos) 964c9dff009189 Alexander Popov 2018-08-17 24 { 964c9dff009189 Alexander Popov 2018-08-17 25 int ret = 0; 964c9dff009189 Alexander Popov 2018-08-17 26 int state = !static_branch_unlikely(&stack_erasing_bypass); 964c9dff009189 Alexander Popov 2018-08-17 27 int prev_state = state; 964c9dff009189 Alexander Popov 2018-08-17 28 964c9dff009189 Alexander Popov 2018-08-17 29 table->data = &state; 964c9dff009189 Alexander Popov 2018-08-17 30 table->maxlen = sizeof(int); 964c9dff009189 Alexander Popov 2018-08-17 31 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); 964c9dff009189 Alexander Popov 2018-08-17 32 state = !!state; 964c9dff009189 Alexander Popov 2018-08-17 33 if (ret || !write || state == prev_state) 964c9dff009189 Alexander Popov 2018-08-17 34 return ret; 964c9dff009189 Alexander Popov 2018-08-17 35 964c9dff009189 Alexander Popov 2018-08-17 36 if (state) 964c9dff009189 Alexander Popov 2018-08-17 37 static_branch_disable(&stack_erasing_bypass); 964c9dff009189 Alexander Popov 2018-08-17 38 else 964c9dff009189 Alexander Popov 2018-08-17 39 static_branch_enable(&stack_erasing_bypass); 964c9dff009189 Alexander Popov 2018-08-17 40 964c9dff009189 Alexander Popov 2018-08-17 41 pr_warn("stackleak: kernel stack erasing is %s\n", 964c9dff009189 Alexander Popov 2018-08-17 @42 state ? "enabled" : "disabled"); 964c9dff009189 Alexander Popov 2018-08-17 43 return ret; 964c9dff009189 Alexander Popov 2018-08-17 44 } 964c9dff009189 Alexander Popov 2018-08-17 45
:::::: The code at line 42 was first introduced by commit :::::: 964c9dff0091893a9a74a88edf984c6da0b779f7 stackleak: Allow runtime disabling of kernel stack erasing
:::::: TO: Alexander Popov alex.popov@linux.com :::::: CC: Kees Cook keescook@chromium.org