tree:
git://git.infradead.org/users/hch/misc.git maccess-fixups.3
head: ffc491b4d7cbc956087e89dbd171863c411f3868
commit: 5de7b23a3f5410a896ab792fd3e580d5f0e54258 [15/18] x86: use non-set_fs based maccess
routines
config: x86_64-randconfig-a001-20200513 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout 5de7b23a3f5410a896ab792fd3e580d5f0e54258
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ld: kernel/trace/bpf_trace.o: in function `bpf_probe_read_kernel_str_common':
kernel/trace/bpf_trace.c:252: undefined reference to `strncpy_from_kernel_nofault'
ld: kernel/trace/bpf_trace.c:252: undefined reference to
`strncpy_from_kernel_nofault'
ld: kernel/trace/bpf_trace.o: in function `bpf_strncpy':
kernel/trace/bpf_trace.c:344: undefined reference to `strncpy_from_kernel_nofault'
ld: kernel/trace/trace_kprobe.o: in function `fetch_store_string':
> kernel/trace/trace_kprobe.c:1250: undefined reference to
`strncpy_from_kernel_nofault'
vim +1250 kernel/trace/trace_kprobe.c
88903c464321cd Masami Hiramatsu 2019-05-15 1229
533059281ee594 Masami Hiramatsu 2018-04-25 1230 /*
533059281ee594 Masami Hiramatsu 2018-04-25 1231 * Fetch a null-terminated string.
Caller MUST set *(u32 *)buf with max
533059281ee594 Masami Hiramatsu 2018-04-25 1232 * length and relative data location.
533059281ee594 Masami Hiramatsu 2018-04-25 1233 */
9178412ddf5a98 Masami Hiramatsu 2018-04-25 1234 static nokprobe_inline int
9178412ddf5a98 Masami Hiramatsu 2018-04-25 1235 fetch_store_string(unsigned long addr,
void *dest, void *base)
533059281ee594 Masami Hiramatsu 2018-04-25 1236 {
9178412ddf5a98 Masami Hiramatsu 2018-04-25 1237 int maxlen = get_loc_len(*(u32
*)dest);
88903c464321cd Masami Hiramatsu 2019-05-15 1238 void *__dest;
533059281ee594 Masami Hiramatsu 2018-04-25 1239 long ret;
533059281ee594 Masami Hiramatsu 2018-04-25 1240
9178412ddf5a98 Masami Hiramatsu 2018-04-25 1241 if (unlikely(!maxlen))
9178412ddf5a98 Masami Hiramatsu 2018-04-25 1242 return -ENOMEM;
88903c464321cd Masami Hiramatsu 2019-05-15 1243
88903c464321cd Masami Hiramatsu 2019-05-15 1244 __dest = get_loc_data(dest, base);
88903c464321cd Masami Hiramatsu 2019-05-15 1245
533059281ee594 Masami Hiramatsu 2018-04-25 1246 /*
533059281ee594 Masami Hiramatsu 2018-04-25 1247 * Try to get string again, since the
string can be changed while
533059281ee594 Masami Hiramatsu 2018-04-25 1248 * probing.
533059281ee594 Masami Hiramatsu 2018-04-25 1249 */
334a11cc65f45f Christoph Hellwig 2020-05-13 @1250 ret =
strncpy_from_kernel_nofault(__dest, (void *)addr, maxlen);
334a11cc65f45f Christoph Hellwig 2020-05-13 1251 if (ret < 0)
334a11cc65f45f Christoph Hellwig 2020-05-13 1252 ret =
strncpy_from_user_nofault(__dest, (void __user *)addr,
334a11cc65f45f Christoph Hellwig 2020-05-13 1253 maxlen);
88903c464321cd Masami Hiramatsu 2019-05-15 1254 if (ret >= 0)
88903c464321cd Masami Hiramatsu 2019-05-15 1255 *(u32 *)dest = make_data_loc(ret,
__dest - base);
88903c464321cd Masami Hiramatsu 2019-05-15 1256
88903c464321cd Masami Hiramatsu 2019-05-15 1257 return ret;
88903c464321cd Masami Hiramatsu 2019-05-15 1258 }
88903c464321cd Masami Hiramatsu 2019-05-15 1259
:::::: The code at line 1250 was first introduced by commit
:::::: 334a11cc65f45f12f7fb8929928e68f7fb63d26d maccess: remove strncpy_from_unsafe
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Christoph Hellwig <hch(a)lst.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org