From: kernel test robot <lkp@intel.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>
Subject: kernel/trace/bpf_trace.c:2254:21: sparse: sparse: dereference of noderef expression
Date: Thu, 28 Dec 2023 01:18:37 +0800 [thread overview]
Message-ID: <202312280124.W09SBhfq-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fbafc3e621c3f4ded43720fdb1d6ce1728ec664e
commit: 0236fec57a15dc2a068dfe4488e0c2ab4559b1ec bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link
date: 1 year, 8 months ago
config: i386-randconfig-061-20231101 (https://download.01.org/0day-ci/archive/20231228/202312280124.W09SBhfq-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231228/202312280124.W09SBhfq-lkp@intel.com/reproduce)
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/202312280124.W09SBhfq-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> kernel/trace/bpf_trace.c:2254:21: sparse: sparse: dereference of noderef expression
kernel/trace/bpf_trace.c:2258:66: sparse: sparse: dereference of noderef expression
vim +2254 kernel/trace/bpf_trace.c
2236
2237 static int copy_user_syms(struct user_syms *us, unsigned long __user *usyms, u32 cnt)
2238 {
2239 unsigned long __user usymbol;
2240 const char **syms = NULL;
2241 char *buf = NULL, *p;
2242 int err = -ENOMEM;
2243 unsigned int i;
2244
2245 syms = kvmalloc(cnt * sizeof(*syms), GFP_KERNEL);
2246 if (!syms)
2247 goto error;
2248
2249 buf = kvmalloc(cnt * KSYM_NAME_LEN, GFP_KERNEL);
2250 if (!buf)
2251 goto error;
2252
2253 for (p = buf, i = 0; i < cnt; i++) {
> 2254 if (__get_user(usymbol, usyms + i)) {
2255 err = -EFAULT;
2256 goto error;
2257 }
2258 err = strncpy_from_user(p, (const char __user *) usymbol, KSYM_NAME_LEN);
2259 if (err == KSYM_NAME_LEN)
2260 err = -E2BIG;
2261 if (err < 0)
2262 goto error;
2263 syms[i] = p;
2264 p += err + 1;
2265 }
2266
2267 us->syms = syms;
2268 us->buf = buf;
2269 return 0;
2270
2271 error:
2272 if (err) {
2273 kvfree(syms);
2274 kvfree(buf);
2275 }
2276 return err;
2277 }
2278
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-12-27 17:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202312280124.W09SBhfq-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox