From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v2 3/3] bpf: eliminate the allocation of an intermediate struct bpf_key
Date: Mon, 4 Aug 2025 09:42:03 +0800 [thread overview]
Message-ID: <202508040803.nwExqJWe-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250730172745.8480-4-James.Bottomley@HansenPartnership.com>
References: <20250730172745.8480-4-James.Bottomley@HansenPartnership.com>
TO: James Bottomley <James.Bottomley@HansenPartnership.com>
TO: bpf@vger.kernel.org
TO: linux-trace-kernel@vger.kernel.org
CC: Roberto Sassu <roberto.sassu@huawei.com>
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bpf-next/master]
[also build test WARNING on bpf/master linus/master v6.16 next-20250801]
[cannot apply to bpf-next/net]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/James-Bottomley/bpf-make-bpf_key-an-opaque-type/20250731-013040
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20250730172745.8480-4-James.Bottomley%40HansenPartnership.com
patch subject: [PATCH v2 3/3] bpf: eliminate the allocation of an intermediate struct bpf_key
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-141-20250803 (https://download.01.org/0day-ci/archive/20250804/202508040803.nwExqJWe-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202508040803.nwExqJWe-lkp@intel.com/
smatch warnings:
kernel/trace/bpf_trace.c:1364 bpf_verify_pkcs7_signature() warn: impossible condition '(key == BUILTIN_KEY) => (0-u32max == u64max)'
vim +1364 kernel/trace/bpf_trace.c
f3cf4134c5c6c4 Roberto Sassu 2022-09-20 1340
865b0566d8f1a0 Roberto Sassu 2022-09-20 1341 #ifdef CONFIG_SYSTEM_DATA_VERIFICATION
865b0566d8f1a0 Roberto Sassu 2022-09-20 1342 /**
865b0566d8f1a0 Roberto Sassu 2022-09-20 1343 * bpf_verify_pkcs7_signature - verify a PKCS#7 signature
cce4c40b960673 Daniel Xu 2024-06-12 1344 * @data_p: data to verify
cce4c40b960673 Daniel Xu 2024-06-12 1345 * @sig_p: signature of the data
865b0566d8f1a0 Roberto Sassu 2022-09-20 1346 * @trusted_keyring: keyring with keys trusted for signature verification
865b0566d8f1a0 Roberto Sassu 2022-09-20 1347 *
865b0566d8f1a0 Roberto Sassu 2022-09-20 1348 * Verify the PKCS#7 signature *sig_ptr* against the supplied *data_ptr*
865b0566d8f1a0 Roberto Sassu 2022-09-20 1349 * with keys in a keyring referenced by *trusted_keyring*.
865b0566d8f1a0 Roberto Sassu 2022-09-20 1350 *
865b0566d8f1a0 Roberto Sassu 2022-09-20 1351 * Return: 0 on success, a negative value on error.
865b0566d8f1a0 Roberto Sassu 2022-09-20 1352 */
cce4c40b960673 Daniel Xu 2024-06-12 1353 __bpf_kfunc int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_p,
cce4c40b960673 Daniel Xu 2024-06-12 1354 struct bpf_dynptr *sig_p,
865b0566d8f1a0 Roberto Sassu 2022-09-20 1355 struct bpf_key *trusted_keyring)
865b0566d8f1a0 Roberto Sassu 2022-09-20 1356 {
cce4c40b960673 Daniel Xu 2024-06-12 1357 struct bpf_dynptr_kern *data_ptr = (struct bpf_dynptr_kern *)data_p;
cce4c40b960673 Daniel Xu 2024-06-12 1358 struct bpf_dynptr_kern *sig_ptr = (struct bpf_dynptr_kern *)sig_p;
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1359 struct key *key = (struct key *)trusted_keyring;
74523c06ae20b8 Song Liu 2023-11-06 1360 const void *data, *sig;
74523c06ae20b8 Song Liu 2023-11-06 1361 u32 data_len, sig_len;
865b0566d8f1a0 Roberto Sassu 2022-09-20 1362 int ret;
865b0566d8f1a0 Roberto Sassu 2022-09-20 1363
9cc2aa8d6b5c93 James Bottomley 2025-07-30 @1364 if ((unsigned long)key == BUILTIN_KEY)
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1365 key = NULL;
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1366
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1367 if (system_keyring_id_check((unsigned long)key) < 0) {
865b0566d8f1a0 Roberto Sassu 2022-09-20 1368 /*
865b0566d8f1a0 Roberto Sassu 2022-09-20 1369 * Do the permission check deferred in bpf_lookup_user_key().
865b0566d8f1a0 Roberto Sassu 2022-09-20 1370 * See bpf_lookup_user_key() for more details.
865b0566d8f1a0 Roberto Sassu 2022-09-20 1371 *
865b0566d8f1a0 Roberto Sassu 2022-09-20 1372 * A call to key_task_permission() here would be redundant, as
865b0566d8f1a0 Roberto Sassu 2022-09-20 1373 * it is already done by keyring_search() called by
865b0566d8f1a0 Roberto Sassu 2022-09-20 1374 * find_asymmetric_key().
865b0566d8f1a0 Roberto Sassu 2022-09-20 1375 */
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1376 ret = key_validate(key);
865b0566d8f1a0 Roberto Sassu 2022-09-20 1377 if (ret < 0)
865b0566d8f1a0 Roberto Sassu 2022-09-20 1378 return ret;
865b0566d8f1a0 Roberto Sassu 2022-09-20 1379 }
865b0566d8f1a0 Roberto Sassu 2022-09-20 1380
74523c06ae20b8 Song Liu 2023-11-06 1381 data_len = __bpf_dynptr_size(data_ptr);
74523c06ae20b8 Song Liu 2023-11-06 1382 data = __bpf_dynptr_data(data_ptr, data_len);
74523c06ae20b8 Song Liu 2023-11-06 1383 sig_len = __bpf_dynptr_size(sig_ptr);
74523c06ae20b8 Song Liu 2023-11-06 1384 sig = __bpf_dynptr_data(sig_ptr, sig_len);
74523c06ae20b8 Song Liu 2023-11-06 1385
9cc2aa8d6b5c93 James Bottomley 2025-07-30 1386 return verify_pkcs7_signature(data, data_len, sig, sig_len, key,
865b0566d8f1a0 Roberto Sassu 2022-09-20 1387 VERIFYING_UNSPECIFIED_SIGNATURE, NULL,
865b0566d8f1a0 Roberto Sassu 2022-09-20 1388 NULL);
865b0566d8f1a0 Roberto Sassu 2022-09-20 1389 }
865b0566d8f1a0 Roberto Sassu 2022-09-20 1390 #endif /* CONFIG_SYSTEM_DATA_VERIFICATION */
865b0566d8f1a0 Roberto Sassu 2022-09-20 1391
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-08-04 1:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 1:42 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-30 17:27 [PATCH v2 0/3] bpf: tidy up internals of bpf key handling James Bottomley
2025-07-30 17:27 ` [PATCH v2 3/3] bpf: eliminate the allocation of an intermediate struct bpf_key James Bottomley
2025-07-31 22:28 ` kernel test robot
2025-08-01 1:59 ` kernel test robot
2025-08-04 6:21 ` Dan Carpenter
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=202508040803.nwExqJWe-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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.