lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210270442.ijGGX0rx-lkp@intel.com>
Date:   Thu, 27 Oct 2022 04:41:58 +0800
From:   kernel test robot <lkp@...el.com>
To:     'Guanjun' <guanjun@...ux.alibaba.com>, herbert@...dor.apana.org.au,
        elliott@....com
Cc:     oe-kbuild-all@...ts.linux.dev, zelin.deng@...ux.alibaba.com,
        artie.ding@...ux.alibaba.com, guanjun@...ux.alibaba.com,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        xuchun.shang@...ux.alibaba.com
Subject: Re: [PATCH v3 5/9] crypto/ycc: Add skcipher algorithm support

Hi 'Guanjun',

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on herbert-crypto-2.6/master linus/master v6.1-rc2 next-20221026]
[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/Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221025-180005
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/1666691616-69983-6-git-send-email-guanjun%40linux.alibaba.com
patch subject: [PATCH v3 5/9] crypto/ycc: Add skcipher algorithm support
config: arm-allmodconfig
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/085f9f4e861489eac45d22a53b0ef9ab669007a9
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221025-180005
        git checkout 085f9f4e861489eac45d22a53b0ef9ab669007a9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/crypto/ycc/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/crypto/ycc/ycc_ske.c:41:5: warning: no previous prototype for 'ycc_skcipher_aes_ecb_setkey' [-Wmissing-prototypes]
      41 | int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:107:1: note: in expansion of macro 'DEFINE_YCC_SKE_AES_SETKEY'
     107 | DEFINE_YCC_SKE_AES_SETKEY(ecb, ECB, 32);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:41:5: warning: no previous prototype for 'ycc_skcipher_aes_cbc_setkey' [-Wmissing-prototypes]
      41 | int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:108:1: note: in expansion of macro 'DEFINE_YCC_SKE_AES_SETKEY'
     108 | DEFINE_YCC_SKE_AES_SETKEY(cbc, CBC, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:41:5: warning: no previous prototype for 'ycc_skcipher_aes_ctr_setkey' [-Wmissing-prototypes]
      41 | int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:109:1: note: in expansion of macro 'DEFINE_YCC_SKE_AES_SETKEY'
     109 | DEFINE_YCC_SKE_AES_SETKEY(ctr, CTR, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:41:5: warning: no previous prototype for 'ycc_skcipher_aes_cfb_setkey' [-Wmissing-prototypes]
      41 | int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:110:1: note: in expansion of macro 'DEFINE_YCC_SKE_AES_SETKEY'
     110 | DEFINE_YCC_SKE_AES_SETKEY(cfb, CFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:41:5: warning: no previous prototype for 'ycc_skcipher_aes_ofb_setkey' [-Wmissing-prototypes]
      41 | int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:111:1: note: in expansion of macro 'DEFINE_YCC_SKE_AES_SETKEY'
     111 | DEFINE_YCC_SKE_AES_SETKEY(ofb, OFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:63:5: warning: no previous prototype for 'ycc_skcipher_sm4_ecb_setkey' [-Wmissing-prototypes]
      63 | int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:113:1: note: in expansion of macro 'DEFINE_YCC_SKE_SM4_SETKEY'
     113 | DEFINE_YCC_SKE_SM4_SETKEY(ecb, ECB, 32);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:63:5: warning: no previous prototype for 'ycc_skcipher_sm4_cbc_setkey' [-Wmissing-prototypes]
      63 | int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:114:1: note: in expansion of macro 'DEFINE_YCC_SKE_SM4_SETKEY'
     114 | DEFINE_YCC_SKE_SM4_SETKEY(cbc, CBC, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:63:5: warning: no previous prototype for 'ycc_skcipher_sm4_ctr_setkey' [-Wmissing-prototypes]
      63 | int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:115:1: note: in expansion of macro 'DEFINE_YCC_SKE_SM4_SETKEY'
     115 | DEFINE_YCC_SKE_SM4_SETKEY(ctr, CTR, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:63:5: warning: no previous prototype for 'ycc_skcipher_sm4_cfb_setkey' [-Wmissing-prototypes]
      63 | int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:116:1: note: in expansion of macro 'DEFINE_YCC_SKE_SM4_SETKEY'
     116 | DEFINE_YCC_SKE_SM4_SETKEY(cfb, CFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:63:5: warning: no previous prototype for 'ycc_skcipher_sm4_ofb_setkey' [-Wmissing-prototypes]
      63 | int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:117:1: note: in expansion of macro 'DEFINE_YCC_SKE_SM4_SETKEY'
     117 | DEFINE_YCC_SKE_SM4_SETKEY(ofb, OFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:74:5: warning: no previous prototype for 'ycc_skcipher_des_ecb_setkey' [-Wmissing-prototypes]
      74 | int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:119:1: note: in expansion of macro 'DEFINE_YCC_SKE_DES_SETKEY'
     119 | DEFINE_YCC_SKE_DES_SETKEY(ecb, ECB, 32);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:74:5: warning: no previous prototype for 'ycc_skcipher_des_cbc_setkey' [-Wmissing-prototypes]
      74 | int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:120:1: note: in expansion of macro 'DEFINE_YCC_SKE_DES_SETKEY'
     120 | DEFINE_YCC_SKE_DES_SETKEY(cbc, CBC, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:74:5: warning: no previous prototype for 'ycc_skcipher_des_ctr_setkey' [-Wmissing-prototypes]
      74 | int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:121:1: note: in expansion of macro 'DEFINE_YCC_SKE_DES_SETKEY'
     121 | DEFINE_YCC_SKE_DES_SETKEY(ctr, CTR, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:74:5: warning: no previous prototype for 'ycc_skcipher_des_cfb_setkey' [-Wmissing-prototypes]
      74 | int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:122:1: note: in expansion of macro 'DEFINE_YCC_SKE_DES_SETKEY'
     122 | DEFINE_YCC_SKE_DES_SETKEY(cfb, CFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:74:5: warning: no previous prototype for 'ycc_skcipher_des_ofb_setkey' [-Wmissing-prototypes]
      74 | int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,       \
         |     ^~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:123:1: note: in expansion of macro 'DEFINE_YCC_SKE_DES_SETKEY'
     123 | DEFINE_YCC_SKE_DES_SETKEY(ofb, OFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:89:5: warning: no previous prototype for 'ycc_skcipher_3des_ecb_setkey' [-Wmissing-prototypes]
      89 | int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,      \
         |     ^~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:125:1: note: in expansion of macro 'DEFINE_YCC_SKE_3DES_SETKEY'
     125 | DEFINE_YCC_SKE_3DES_SETKEY(ecb, ECB, 32);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:89:5: warning: no previous prototype for 'ycc_skcipher_3des_cbc_setkey' [-Wmissing-prototypes]
      89 | int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,      \
         |     ^~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:126:1: note: in expansion of macro 'DEFINE_YCC_SKE_3DES_SETKEY'
     126 | DEFINE_YCC_SKE_3DES_SETKEY(cbc, CBC, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:89:5: warning: no previous prototype for 'ycc_skcipher_3des_ctr_setkey' [-Wmissing-prototypes]
      89 | int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,      \
         |     ^~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:127:1: note: in expansion of macro 'DEFINE_YCC_SKE_3DES_SETKEY'
     127 | DEFINE_YCC_SKE_3DES_SETKEY(ctr, CTR, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:89:5: warning: no previous prototype for 'ycc_skcipher_3des_cfb_setkey' [-Wmissing-prototypes]
      89 | int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,      \
         |     ^~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:128:1: note: in expansion of macro 'DEFINE_YCC_SKE_3DES_SETKEY'
     128 | DEFINE_YCC_SKE_3DES_SETKEY(cfb, CFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/ycc/ycc_ske.c:89:5: warning: no previous prototype for 'ycc_skcipher_3des_ofb_setkey' [-Wmissing-prototypes]
      89 | int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,      \
         |     ^~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:129:1: note: in expansion of macro 'DEFINE_YCC_SKE_3DES_SETKEY'
     129 | DEFINE_YCC_SKE_3DES_SETKEY(ofb, OFB, 48);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:131:5: warning: no previous prototype for 'ycc_skcipher_aes_xts_setkey' [-Wmissing-prototypes]
     131 | int ycc_skcipher_aes_xts_setkey(struct crypto_skcipher *tfm,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c:157:5: warning: no previous prototype for 'ycc_skcipher_sm4_xts_setkey' [-Wmissing-prototypes]
     157 | int ycc_skcipher_sm4_xts_setkey(struct crypto_skcipher *tfm,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/ycc/ycc_ske.c: In function 'ycc_skcipher_submit_desc':
   drivers/crypto/ycc/ycc_ske.c:384:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     384 |         req->desc.private_ptr = (u64)aflags;
         |                                 ^


vim +/ycc_skcipher_aes_ecb_setkey +41 drivers/crypto/ycc/ycc_ske.c

    39	
    40	#define DEFINE_YCC_SKE_AES_SETKEY(name, mode, size)			\
  > 41	int ycc_skcipher_aes_##name##_setkey(struct crypto_skcipher *tfm,	\
    42					     const u8 *key,			\
    43					     unsigned int key_size)		\
    44	{									\
    45		int alg_mode;							\
    46		switch (key_size) {						\
    47		case AES_KEYSIZE_128:						\
    48			alg_mode = YCC_AES_128_##mode;				\
    49			break;							\
    50		case AES_KEYSIZE_192:						\
    51			alg_mode = YCC_AES_192_##mode;				\
    52			break;							\
    53		case AES_KEYSIZE_256:						\
    54			alg_mode = YCC_AES_256_##mode;				\
    55			break;							\
    56		default:							\
    57			return -EINVAL;						\
    58		}								\
    59		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, size);	\
    60	}
    61	
    62	#define DEFINE_YCC_SKE_SM4_SETKEY(name, mode, size)			\
  > 63	int ycc_skcipher_sm4_##name##_setkey(struct crypto_skcipher *tfm,	\
    64					     const u8 *key,			\
    65					     unsigned int key_size)		\
    66	{									\
    67		int alg_mode = YCC_SM4_##mode;					\
    68		if (key_size != SM4_KEY_SIZE)					\
    69			return -EINVAL;						\
    70		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, size);	\
    71	}
    72	
    73	#define DEFINE_YCC_SKE_DES_SETKEY(name, mode, size)			\
  > 74	int ycc_skcipher_des_##name##_setkey(struct crypto_skcipher *tfm,	\
    75					     const u8 *key,			\
    76					     unsigned int key_size)		\
    77	{									\
    78		int alg_mode = YCC_DES_##mode;					\
    79		int ret;							\
    80		if (key_size != DES_KEY_SIZE)					\
    81			return -EINVAL;						\
    82		ret = verify_skcipher_des_key(tfm, key);			\
    83		if (ret)							\
    84			return ret;						\
    85		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, size);	\
    86	}
    87	
    88	#define DEFINE_YCC_SKE_3DES_SETKEY(name, mode, size)			\
  > 89	int ycc_skcipher_3des_##name##_setkey(struct crypto_skcipher *tfm,	\
    90					      const u8 *key,			\
    91					      unsigned int key_size)		\
    92	{									\
    93		int alg_mode = YCC_TDES_192_##mode;				\
    94		int ret;							\
    95		if (key_size != DES3_EDE_KEY_SIZE)				\
    96			return -EINVAL;						\
    97		ret = verify_skcipher_des3_key(tfm, key);			\
    98		if (ret)							\
    99			return ret;						\
   100		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, size);	\
   101	}
   102	
   103	/*
   104	 * ECB: Only has 1 key, without IV, at least 32 bytes.
   105	 * Others except XTS: |key|iv|, at least 48 bytes.
   106	 */
 > 107	DEFINE_YCC_SKE_AES_SETKEY(ecb, ECB, 32);
 > 108	DEFINE_YCC_SKE_AES_SETKEY(cbc, CBC, 48);
 > 109	DEFINE_YCC_SKE_AES_SETKEY(ctr, CTR, 48);
 > 110	DEFINE_YCC_SKE_AES_SETKEY(cfb, CFB, 48);
 > 111	DEFINE_YCC_SKE_AES_SETKEY(ofb, OFB, 48);
   112	
 > 113	DEFINE_YCC_SKE_SM4_SETKEY(ecb, ECB, 32);
 > 114	DEFINE_YCC_SKE_SM4_SETKEY(cbc, CBC, 48);
 > 115	DEFINE_YCC_SKE_SM4_SETKEY(ctr, CTR, 48);
 > 116	DEFINE_YCC_SKE_SM4_SETKEY(cfb, CFB, 48);
 > 117	DEFINE_YCC_SKE_SM4_SETKEY(ofb, OFB, 48);
   118	
 > 119	DEFINE_YCC_SKE_DES_SETKEY(ecb, ECB, 32);
 > 120	DEFINE_YCC_SKE_DES_SETKEY(cbc, CBC, 48);
 > 121	DEFINE_YCC_SKE_DES_SETKEY(ctr, CTR, 48);
 > 122	DEFINE_YCC_SKE_DES_SETKEY(cfb, CFB, 48);
 > 123	DEFINE_YCC_SKE_DES_SETKEY(ofb, OFB, 48);
   124	
 > 125	DEFINE_YCC_SKE_3DES_SETKEY(ecb, ECB, 32);
 > 126	DEFINE_YCC_SKE_3DES_SETKEY(cbc, CBC, 48);
 > 127	DEFINE_YCC_SKE_3DES_SETKEY(ctr, CTR, 48);
 > 128	DEFINE_YCC_SKE_3DES_SETKEY(cfb, CFB, 48);
   129	DEFINE_YCC_SKE_3DES_SETKEY(ofb, OFB, 48);
   130	
 > 131	int ycc_skcipher_aes_xts_setkey(struct crypto_skcipher *tfm,
   132					const u8 *key,
   133					unsigned int key_size)
   134	{
   135		int alg_mode;
   136		int ret;
   137	
   138		ret = xts_verify_key(tfm, key, key_size);
   139		if (ret)
   140			return ret;
   141	
   142		switch (key_size) {
   143		case AES_KEYSIZE_128 * 2:
   144			alg_mode = YCC_AES_128_XTS;
   145			break;
   146		case AES_KEYSIZE_256 * 2:
   147			alg_mode = YCC_AES_256_XTS;
   148			break;
   149		default:
   150			return -EINVAL;
   151		}
   152	
   153		/* XTS: |key1|key2|iv|, at least 32 + 32 + 16 bytes */
   154		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, 80);
   155	}
   156	
 > 157	int ycc_skcipher_sm4_xts_setkey(struct crypto_skcipher *tfm,
   158					const u8 *key,
   159					unsigned int key_size)
   160	{
   161		int alg_mode;
   162		int ret;
   163	
   164		ret = xts_verify_key(tfm, key, key_size);
   165		if (ret)
   166			return ret;
   167	
   168		if (key_size != SM4_KEY_SIZE * 2)
   169			return -EINVAL;
   170	
   171		alg_mode = YCC_SM4_XTS;
   172		return ycc_skcipher_setkey(tfm, key, key_size, alg_mode, 80);
   173	}
   174	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (354939 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ