From: kernel test robot <lkp@intel.com>
To: jason.zeng@intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [bytedance:5.15-velinux 0/92] net/bpf/bpf_dummy_struct_ops.c:36:11: warning: default initialization of an object of type 'typeof ((kattr->test.ctx_in))' (aka 'const unsigned long long') leaves the object uninitialized
Date: Tue, 29 Jul 2025 12:34:04 +0200 [thread overview]
Message-ID: <202507291249.2TD46HJE-lkp@intel.com> (raw)
tree: https://github.com/bytedance/kernel.git 5.15-velinux
head: c71e88ad12bfbc44f855b681ef923e1acc2e984a
commit: 4f78bb6527470bdf3309b62e7767279657a265c0 [0/92] bpf: Add dummy BPF STRUCT_OPS for test purpose
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250729/202507291249.2TD46HJE-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
rustc: rustc 1.58.0 (02072b482 2022-01-11)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250729/202507291249.2TD46HJE-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/202507291249.2TD46HJE-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> net/bpf/bpf_dummy_struct_ops.c:36:11: warning: default initialization of an object of type 'typeof ((kattr->test.ctx_in))' (aka 'const unsigned long long') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
36 | ctx_in = u64_to_user_ptr(kattr->test.ctx_in);
| ^
include/linux/kernel.h:50:2: note: expanded from macro 'u64_to_user_ptr'
50 | typecheck(u64, (x)); \
| ^
include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck'
11 | typeof(x) __dummy2; \
| ^
1 warning generated.
vim +36 net/bpf/bpf_dummy_struct_ops.c
19
20 static struct bpf_dummy_ops_test_args *
21 dummy_ops_init_args(const union bpf_attr *kattr, unsigned int nr)
22 {
23 __u32 size_in;
24 struct bpf_dummy_ops_test_args *args;
25 void __user *ctx_in;
26 void __user *u_state;
27
28 size_in = kattr->test.ctx_size_in;
29 if (size_in != sizeof(u64) * nr)
30 return ERR_PTR(-EINVAL);
31
32 args = kzalloc(sizeof(*args), GFP_KERNEL);
33 if (!args)
34 return ERR_PTR(-ENOMEM);
35
> 36 ctx_in = u64_to_user_ptr(kattr->test.ctx_in);
37 if (copy_from_user(args->args, ctx_in, size_in))
38 goto out;
39
40 /* args[0] is 0 means state argument of test_N will be NULL */
41 u_state = u64_to_user_ptr(args->args[0]);
42 if (u_state && copy_from_user(&args->state, u_state,
43 sizeof(args->state)))
44 goto out;
45
46 return args;
47 out:
48 kfree(args);
49 return ERR_PTR(-EFAULT);
50 }
51
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-07-29 10:34 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=202507291249.2TD46HJE-lkp@intel.com \
--to=lkp@intel.com \
--cc=jason.zeng@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.