From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v2 1/4] tpm2-sessions: fix out of range indexing in name_size
Date: Thu, 4 Dec 2025 21:33:23 +0800 [thread overview]
Message-ID: <202512042132.PC26URPL-lkp@intel.com> (raw)
In-Reply-To: <20251202202643.107108-2-jarkko@kernel.org>
Hi Jarkko,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20251202]
[also build test WARNING on v6.18]
[cannot apply to char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus linus/master v6.18 v6.18-rc7 v6.18-rc6]
[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/Jarkko-Sakkinen/tpm2-sessions-fix-out-of-range-indexing-in-name_size/20251203-042945
base: next-20251202
patch link: https://lore.kernel.org/r/20251202202643.107108-2-jarkko%40kernel.org
patch subject: [PATCH v2 1/4] tpm2-sessions: fix out of range indexing in name_size
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20251204/202512042132.PC26URPL-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251204/202512042132.PC26URPL-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/202512042132.PC26URPL-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/char/tpm/tpm2-sessions.c:66:
In file included from drivers/char/tpm/tpm.h:28:
include/linux/tpm_eventlog.h:167:6: warning: variable 'mapping_size' set but not used [-Wunused-but-set-variable]
167 | int mapping_size;
| ^
>> drivers/char/tpm/tpm2-sessions.c:161:46: warning: invalid conversion specifier '\x0a' [-Wformat-invalid-specifier]
161 | pr_warn("tpm: invalid name algorithm: 0x%04\n", hash_alg);
| ~~~^
include/linux/printk.h:565:29: note: expanded from macro 'pr_warn'
565 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~
include/linux/printk.h:402:21: note: expanded from macro 'pr_fmt'
402 | #define pr_fmt(fmt) fmt
| ^~~
include/linux/printk.h:512:53: note: expanded from macro 'printk'
512 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ^~~
include/linux/printk.h:484:11: note: expanded from macro 'printk_index_wrap'
484 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
2 warnings generated.
vim +/x0a +161 drivers/char/tpm/tpm2-sessions.c
142
143 #ifdef CONFIG_TCG_TPM2_HMAC
144 /*
145 * Name Size based on TPM algorithm (assumes no hash bigger than 255)
146 */
147 static int name_size(const u8 *name)
148 {
149 u16 hash_alg = get_unaligned_be16(name);
150
151 switch (hash_alg) {
152 case TPM_ALG_SHA1:
153 return SHA1_DIGEST_SIZE + 2;
154 case TPM_ALG_SHA256:
155 return SHA256_DIGEST_SIZE + 2;
156 case TPM_ALG_SHA384:
157 return SHA384_DIGEST_SIZE + 2;
158 case TPM_ALG_SHA512:
159 return SHA512_DIGEST_SIZE + 2;
160 default:
> 161 pr_warn("tpm: invalid name algorithm: 0x%04\n", hash_alg);
162 return -EINVAL;
163 }
164 }
165
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
parent reply other threads:[~2025-12-04 13:34 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20251202202643.107108-2-jarkko@kernel.org>]
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=202512042132.PC26URPL-lkp@intel.com \
--to=lkp@intel.com \
--cc=jarkko@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