mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Cedric Xing <cedric.xing@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>
Subject: samples/tsm-mr/tsm_mr_sample.c:52:undefined reference to `crypto_alloc_shash'
Date: Wed, 18 Mar 2026 03:26:13 +0800	[thread overview]
Message-ID: <202603180323.NgdTrvDk-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2d1373e4246da3b58e1df058374ed6b101804e07
commit: f6953f1f9ec4ad68651d7c677f0c065cb4c1edf7 tsm-mr: Add tsm-mr sample code
date:   10 months ago
config: i386-randconfig-r134-20260317 (https://download.01.org/0day-ci/archive/20260318/202603180323.NgdTrvDk-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260318/202603180323.NgdTrvDk-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/202603180323.NgdTrvDk-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: samples/tsm-mr/tsm_mr_sample.o: in function `sample_report_extend_mr':
>> samples/tsm-mr/tsm_mr_sample.c:52:(.text+0x4f): undefined reference to `crypto_alloc_shash'
   ld: samples/tsm-mr/tsm_mr_sample.c:60:(.text+0x9d): undefined reference to `crypto_shash_update'
   ld: samples/tsm-mr/tsm_mr_sample.c:62:(.text+0xb6): undefined reference to `crypto_shash_finup'
   ld: samples/tsm-mr/tsm_mr_sample.o: in function `sample_report_refresh':
   samples/tsm-mr/tsm_mr_sample.c:29:(.text+0x104): undefined reference to `crypto_alloc_shash'
>> ld: samples/tsm-mr/tsm_mr_sample.c:35:(.text+0x12b): undefined reference to `crypto_shash_tfm_digest'


vim +52 samples/tsm-mr/tsm_mr_sample.c

    23	
    24	static int sample_report_refresh(const struct tsm_measurements *tm)
    25	{
    26		struct crypto_shash *tfm;
    27		int rc;
    28	
    29		tfm = crypto_alloc_shash(hash_algo_name[HASH_ALGO_SHA512], 0, 0);
    30		if (IS_ERR(tfm)) {
    31			pr_err("crypto_alloc_shash failed: %ld\n", PTR_ERR(tfm));
    32			return PTR_ERR(tfm);
    33		}
    34	
  > 35		rc = crypto_shash_tfm_digest(tfm, (u8 *)&sample_report,
    36					     offsetof(typeof(sample_report),
    37						      report_digest),
    38					     sample_report.report_digest);
    39		crypto_free_shash(tfm);
    40		if (rc)
    41			pr_err("crypto_shash_tfm_digest failed: %d\n", rc);
    42		return rc;
    43	}
    44	
    45	static int sample_report_extend_mr(const struct tsm_measurements *tm,
    46					   const struct tsm_measurement_register *mr,
    47					   const u8 *data)
    48	{
    49		SHASH_DESC_ON_STACK(desc, 0);
    50		int rc;
    51	
  > 52		desc->tfm = crypto_alloc_shash(hash_algo_name[mr->mr_hash], 0, 0);
    53		if (IS_ERR(desc->tfm)) {
    54			pr_err("crypto_alloc_shash failed: %ld\n", PTR_ERR(desc->tfm));
    55			return PTR_ERR(desc->tfm);
    56		}
    57	
    58		rc = crypto_shash_init(desc);
    59		if (!rc)
    60			rc = crypto_shash_update(desc, mr->mr_value, mr->mr_size);
    61		if (!rc)
    62			rc = crypto_shash_finup(desc, data, mr->mr_size, mr->mr_value);
    63		crypto_free_shash(desc->tfm);
    64		if (rc)
    65			pr_err("SHA calculation failed: %d\n", rc);
    66		return rc;
    67	}
    68	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-03-17 19:26 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=202603180323.NgdTrvDk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cedric.xing@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®