[PATCH 01/12] bpf: Implement an internal helper for SHA256 hashing

kernel test robot lkp at intel.com
Mon Jun 9 09:31:41 UTC 2025


Hi KP,

kernel test robot noticed the following build errors:

[auto build test ERROR on bpf-next/net]
[also build test ERROR on bpf-next/master bpf/master linus/master v6.16-rc1 next-20250606]
[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/KP-Singh/bpf-Implement-an-internal-helper-for-SHA256-hashing/20250607-073052
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git net
patch link:    https://lore.kernel.org/r/20250606232914.317094-2-kpsingh%40kernel.org
patch subject: [PATCH 01/12] bpf: Implement an internal helper for SHA256 hashing
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20250609/202506091719.RN2qjs3P-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250609/202506091719.RN2qjs3P-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506091719.RN2qjs3P-lkp@intel.com/

All errors (new ones prefixed by >>):

   alpha-linux-ld: kernel/bpf/core.o: in function `bpf_sha256':
>> kernel/bpf/core.c:298:(.text+0x502c): undefined reference to `crypto_alloc_shash'
>> alpha-linux-ld: kernel/bpf/core.c:298:(.text+0x5058): undefined reference to `crypto_alloc_shash'
>> alpha-linux-ld: kernel/bpf/core.c:311:(.text+0x50a4): undefined reference to `crypto_shash_init'
   alpha-linux-ld: kernel/bpf/core.c:311:(.text+0x50b0): undefined reference to `crypto_shash_init'
   alpha-linux-ld: kernel/bpf/core.o: in function `crypto_free_shash':
>> include/crypto/hash.h:765:(.text+0x50e0): undefined reference to `crypto_destroy_tfm'
>> alpha-linux-ld: include/crypto/hash.h:765:(.text+0x50e4): undefined reference to `crypto_destroy_tfm'
   alpha-linux-ld: kernel/bpf/core.o: in function `crypto_shash_update':
>> include/crypto/hash.h:992:(.text+0x5120): undefined reference to `crypto_shash_finup'
>> alpha-linux-ld: include/crypto/hash.h:992:(.text+0x5124): undefined reference to `crypto_shash_finup'
   alpha-linux-ld: kernel/bpf/core.o: in function `crypto_shash_final':
   include/crypto/hash.h:1011:(.text+0x5138): undefined reference to `crypto_shash_finup'
   alpha-linux-ld: include/crypto/hash.h:1011:(.text+0x5148): undefined reference to `crypto_shash_finup'
   alpha-linux-ld: kernel/bpf/core.o: in function `crypto_free_shash':
   include/crypto/hash.h:765:(.text+0x5158): undefined reference to `crypto_destroy_tfm'
   alpha-linux-ld: include/crypto/hash.h:765:(.text+0x5164): undefined reference to `crypto_destroy_tfm'


vim +298 kernel/bpf/core.c

   290	
   291	int bpf_sha256(u8 *data, size_t data_size, u8 *output_digest)
   292	{
   293		struct crypto_shash *tfm;
   294		struct shash_desc *shash_desc;
   295		size_t desc_size;
   296		int ret = 0;
   297	
 > 298		tfm = crypto_alloc_shash("sha256", 0, 0);
   299		if (IS_ERR(tfm))
   300			return PTR_ERR(tfm);
   301	
   302	
   303		desc_size = crypto_shash_descsize(tfm) + sizeof(*shash_desc);
   304		shash_desc = kmalloc(desc_size, GFP_KERNEL);
   305		if (!shash_desc) {
   306			crypto_free_shash(tfm);
   307			return -ENOMEM;
   308		}
   309	
   310		shash_desc->tfm = tfm;
 > 311		ret = crypto_shash_init(shash_desc);
   312		if (ret)
   313			goto out_free_desc;
   314	
   315		ret = crypto_shash_update(shash_desc, data, data_size);
   316		if (ret)
   317			goto out_free_desc;
   318	
   319		ret = crypto_shash_final(shash_desc, output_digest);
   320		if (ret)
   321			goto out_free_desc;
   322	
   323	out_free_desc:
   324		kfree(shash_desc);
   325		crypto_free_shash(tfm);
   326		return ret;
   327	}
   328	

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



More information about the Linux-security-module-archive mailing list