Re: [PATCH] kprobes: stacktrace: Recover the address changed by kretprobe
Hi Masami, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.12-rc1 next-20210304] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f69d02e37a85645aa90d18cacfff36dba370f797 config: parisc-allyesconfig (attached as .config) compiler: hppa-linux-gcc (GCC) 9.3.0 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://github.com/0day-ci/linux/commit/2204ff150821a6a3c13b4fa10784b5efb3e3adc8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 git checkout 2204ff150821a6a3c13b4fa10784b5efb3e3adc8 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): kernel/kprobes.c:1847:12: warning: no previous prototype for 'kprobe_exceptions_notify' [-Wmissing-prototypes] 1847 | int __weak kprobe_exceptions_notify(struct notifier_block *self, |^~~~ kernel/kprobes.c: In function 'kretprobe_real_stack_tsk': >> kernel/kprobes.c:1874:30: error: 'kretprobe_trampoline' undeclared (first >> use in this function); did you mean 'kretprobe_blackpoint'? 1874 | if (addr != (unsigned long)_trampoline) | ^~~~ | kretprobe_blackpoint kernel/kprobes.c:1874:30: note: each undeclared identifier is reported only once for each function it appears in kernel/kprobes.c: In function '__kretprobe_trampoline_handler': kernel/kprobes.c:1904:21: error: 'kretprobe_trampoline' undeclared (first use in this function); did you mean 'kretprobe_blackpoint'? 1904 | (unsigned long)_trampoline, ); | ^~~~ | kretprobe_blackpoint vim +1874 kernel/kprobes.c 1865 1866 /* This assumes the tsk is current or the task which is not running. */ 1867 unsigned long kretprobe_real_stack_tsk(struct task_struct *tsk, 1868 unsigned long addr, 1869 struct llist_node **cur) 1870 { 1871 struct kretprobe_instance *ri = NULL; 1872 struct llist_node *node = *cur; 1873 > 1874 if (addr != (unsigned long)_trampoline) 1875 return addr; 1876 1877 if (!node) 1878 node = tsk->kretprobe_instances.first; 1879 else 1880 node = node->next; 1881 1882 while (node) { 1883 ri = container_of(node, struct kretprobe_instance, llist); 1884 if (ri->ret_addr != (void *)_trampoline) { 1885 *cur = node; 1886 return (unsigned long)ri->ret_addr; 1887 } 1888 node = node->next; 1889 } 1890 return 0; 1891 } 1892 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip
Re: [PATCH] kprobes: stacktrace: Recover the address changed by kretprobe
Hi Masami, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.12-rc1 next-20210304] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f69d02e37a85645aa90d18cacfff36dba370f797 config: arm64-randconfig-r023-20210304 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project eec7f8f7b1226be422a76542cb403d02538f453a) 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 # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/0day-ci/linux/commit/2204ff150821a6a3c13b4fa10784b5efb3e3adc8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 git checkout 2204ff150821a6a3c13b4fa10784b5efb3e3adc8 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): >> kernel/stacktrace.c:97:9: error: implicit declaration of function >> 'kretprobe_real_stack_tsk' [-Werror,-Wimplicit-function-declaration] addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); ^ >> kernel/stacktrace.c:97:37: error: no member named 'tsk' in 'struct >> stacktrace_cookie' addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); ~ ^ >> kernel/stacktrace.c:97:52: error: no member named 'cur' in 'struct >> stacktrace_cookie' addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); ~ ^ 3 errors generated. vim +/kretprobe_real_stack_tsk +97 kernel/stacktrace.c 85 86 static bool stack_trace_consume_entry(void *cookie, unsigned long addr) 87 { 88 struct stacktrace_cookie *c = cookie; 89 90 if (c->len >= c->size) 91 return false; 92 93 if (c->skip > 0) { 94 c->skip--; 95 return true; 96 } > 97 addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); 98 c->store[c->len++] = addr; 99 return c->len < c->size; 100 } 101 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip
Re: [PATCH] kprobes: stacktrace: Recover the address changed by kretprobe
Hi Masami, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.12-rc1 next-20210304] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f69d02e37a85645aa90d18cacfff36dba370f797 config: x86_64-randconfig-m001-20210304 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/2204ff150821a6a3c13b4fa10784b5efb3e3adc8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Masami-Hiramatsu/kprobes-stacktrace-Recover-the-address-changed-by-kretprobe/20210304-212528 git checkout 2204ff150821a6a3c13b4fa10784b5efb3e3adc8 # save the attached .config to linux build tree make W=1 ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): kernel/stacktrace.c: In function 'stack_trace_consume_entry': >> kernel/stacktrace.c:97:9: error: implicit declaration of function >> 'kretprobe_real_stack_tsk' [-Werror=implicit-function-declaration] 97 | addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); | ^~~~ >> kernel/stacktrace.c:97:35: error: 'struct stacktrace_cookie' has no member >> named 'tsk' 97 | addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); | ^~ >> kernel/stacktrace.c:97:50: error: 'struct stacktrace_cookie' has no member >> named 'cur' 97 | addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); | ^~ cc1: some warnings being treated as errors vim +/kretprobe_real_stack_tsk +97 kernel/stacktrace.c 85 86 static bool stack_trace_consume_entry(void *cookie, unsigned long addr) 87 { 88 struct stacktrace_cookie *c = cookie; 89 90 if (c->len >= c->size) 91 return false; 92 93 if (c->skip > 0) { 94 c->skip--; 95 return true; 96 } > 97 addr = kretprobe_real_stack_tsk(c->tsk, addr, >cur); 98 c->store[c->len++] = addr; 99 return c->len < c->size; 100 } 101 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip