From: kernel test robot <lkp@intel.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jolsa-perf:uprobe_multi_6 1/12] kernel/trace/bpf_trace.c:3055:12: warning: variable 'old_inode' is uninitialized when used here
Date: Tue, 14 Mar 2023 12:16:30 +0800 [thread overview]
Message-ID: <202303141241.Nw4DnamW-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git uprobe_multi_6
head: 3f2899fc03dd194fc538daca944ed9560d265fb3
commit: 8dd01ea9b045f53b6b8625fde50a896de89e075d [1/12] bpf: Add multi uprobe link
config: x86_64-randconfig-a014-20230313 (https://download.01.org/0day-ci/archive/20230314/202303141241.Nw4DnamW-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/jolsa/perf.git/commit/?id=8dd01ea9b045f53b6b8625fde50a896de89e075d
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf uprobe_multi_6
git checkout 8dd01ea9b045f53b6b8625fde50a896de89e075d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/trace/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303141241.Nw4DnamW-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/trace/bpf_trace.c:3055:12: warning: variable 'old_inode' is uninitialized when used here [-Wuninitialized]
inode = old_inode;
^~~~~~~~~
kernel/trace/bpf_trace.c:3011:33: note: initialize the variable 'old_inode' to silence this warning
struct inode *inode, *old_inode;
^
= NULL
1 warning generated.
vim +/old_inode +3055 kernel/trace/bpf_trace.c
3003
3004 int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
3005 {
3006 void __user **upaths, __user *upath, __user *old_upath = NULL;
3007 unsigned long __user *uoffsets, offset;
3008 struct bpf_uprobe_multi_link *link = NULL;
3009 struct bpf_link_primer link_primer;
3010 struct bpf_uprobe *uprobes = NULL;
3011 struct inode *inode, *old_inode;
3012 u32 flags, cnt, i;
3013 int err;
3014
3015 /* no support for 32bit archs yet */
3016 if (sizeof(u64) != sizeof(void *))
3017 return -EOPNOTSUPP;
3018
3019 if (prog->expected_attach_type != BPF_TRACE_UPROBE_MULTI)
3020 return -EINVAL;
3021
3022 flags = attr->link_create.uprobe_multi.flags;
3023 if (flags & ~BPF_F_UPROBE_MULTI_RETURN)
3024 return -EINVAL;
3025
3026 upaths = u64_to_user_ptr(attr->link_create.uprobe_multi.paths);
3027 uoffsets = u64_to_user_ptr(attr->link_create.uprobe_multi.offsets);
3028 if (!!upaths != !!uoffsets)
3029 return -EINVAL;
3030
3031 cnt = attr->link_create.uprobe_multi.cnt;
3032 if (!cnt)
3033 return -EINVAL;
3034
3035 uprobes = kvcalloc(cnt, sizeof(*uprobes), GFP_KERNEL);
3036 if (!uprobes)
3037 return -ENOMEM;
3038
3039 link = kzalloc(sizeof(*link), GFP_KERNEL);
3040 if (!link) {
3041 err = -ENOMEM;
3042 goto error;
3043 }
3044
3045 for (i = 0; i < cnt; i++) {
3046 if (__get_user(offset, uoffsets + i)) {
3047 err = -EFAULT;
3048 goto error;
3049 }
3050 if (__get_user(upath, upaths + i)) {
3051 err = -EFAULT;
3052 goto error;
3053 }
3054 if (i && old_upath == upath) {
> 3055 inode = old_inode;
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
reply other threads:[~2023-03-14 4:17 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=202303141241.Nw4DnamW-lkp@intel.com \
--to=lkp@intel.com \
--cc=jolsa@kernel.org \
--cc=llvm@lists.linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).