public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/4] tpm2-sessions: fix out of range indexing in name_size
       [not found] <20251202202643.107108-2-jarkko@kernel.org>
@ 2025-12-04 13:33 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-04 13:33 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: llvm, oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-04 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251202202643.107108-2-jarkko@kernel.org>
2025-12-04 13:33 ` [PATCH v2 1/4] tpm2-sessions: fix out of range indexing in name_size kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox