]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hisilicon - Cap block size at 2^31
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 4 Jun 2020 07:37:50 +0000 (17:37 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 15 Jun 2020 07:38:53 +0000 (17:38 +1000)
commitaf5c8f4fe7660bad8cd4bc1f889bbfb4cc25dd09
tree44e1bbdc760d7346de3716d8e88f8143ecb0f338
parent975209ce424b773ac63547e2a01916079beaa116
crypto: hisilicon - Cap block size at 2^31

The function hisi_acc_create_sg_pool may allocate a block of
memory of size PAGE_SIZE * 2^(MAX_ORDER - 1).  This value may
exceed 2^31 on ia64, which would overflow the u32.

This patch caps it at 2^31.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 925243c660a3 ("crypto: hisilicon - fix large sgl memory...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/sgl.c