Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Remove user triggerable pr_err calls

Remove the pr_err calls that are issued during parameter
checking in some AES operations. This will eliminate the
possibility of filling up syslog through these paths.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Tom Lendacky and committed by
Herbert Xu
369f3dab d5aa8095

+7 -21
+1 -3
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
··· 63 63 unsigned int len, need_pad, sg_count; 64 64 int ret; 65 65 66 - if (!ctx->u.aes.key_len) { 67 - pr_err("AES key not set\n"); 66 + if (!ctx->u.aes.key_len) 68 67 return -EINVAL; 69 - } 70 68 71 69 if (nbytes) 72 70 rctx->null_msg = 0;
+3 -9
drivers/crypto/ccp/ccp-crypto-aes-xts.c
··· 125 125 unsigned int unit; 126 126 int ret; 127 127 128 - if (!ctx->u.aes.key_len) { 129 - pr_err("AES key not set\n"); 128 + if (!ctx->u.aes.key_len) 130 129 return -EINVAL; 131 - } 132 130 133 - if (req->nbytes & (AES_BLOCK_SIZE - 1)) { 134 - pr_err("AES request size is not a multiple of the block size\n"); 131 + if (req->nbytes & (AES_BLOCK_SIZE - 1)) 135 132 return -EINVAL; 136 - } 137 133 138 - if (!req->info) { 139 - pr_err("AES IV not supplied"); 134 + if (!req->info) 140 135 return -EINVAL; 141 - } 142 136 143 137 for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) 144 138 if (!(req->nbytes & (unit_size_map[unit].size - 1)))
+3 -9
drivers/crypto/ccp/ccp-crypto-aes.c
··· 76 76 unsigned int iv_len = 0; 77 77 int ret; 78 78 79 - if (!ctx->u.aes.key_len) { 80 - pr_err("AES key not set\n"); 79 + if (!ctx->u.aes.key_len) 81 80 return -EINVAL; 82 - } 83 81 84 82 if (((ctx->u.aes.mode == CCP_AES_MODE_ECB) || 85 83 (ctx->u.aes.mode == CCP_AES_MODE_CBC) || 86 84 (ctx->u.aes.mode == CCP_AES_MODE_CFB)) && 87 - (req->nbytes & (AES_BLOCK_SIZE - 1))) { 88 - pr_err("AES request size is not a multiple of the block size\n"); 85 + (req->nbytes & (AES_BLOCK_SIZE - 1))) 89 86 return -EINVAL; 90 - } 91 87 92 88 if (ctx->u.aes.mode != CCP_AES_MODE_ECB) { 93 - if (!req->info) { 94 - pr_err("AES IV not supplied"); 89 + if (!req->info) 95 90 return -EINVAL; 96 - } 97 91 98 92 memcpy(rctx->iv, req->info, AES_BLOCK_SIZE); 99 93 iv_sg = &rctx->iv_sg;