]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hisilicon/zip - fix zero length input in GZIP decompress
authorZhou Wang <wangzhou1@hisilicon.com>
Fri, 25 Sep 2020 14:06:15 +0000 (22:06 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Oct 2020 08:02:13 +0000 (18:02 +1000)
commit074182288aadc772f4ee0fe3a2df0ce4b78f8c5a
tree270b6e754f310c2c14965cd79a72d177c05dd498
parentf8f2fd62e5ae00835e41b7968eb65defa0e48df0
crypto: hisilicon/zip - fix zero length input in GZIP decompress

The zero length input will cause a call trace when use GZIP
decompress like this:
    Unable to handle kernel paging request at virtual address
    ...
    lr : get_gzip_head_size+0x7c/0xd0 [hisi_zip]

Judge the input length and return '-EINVAL' when input is invalid.

Fixes: e8aa8f6cd449("crypto: hisilicon - add HiSilicon ZIP...")
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Yang Shen <shenyang39@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/zip/zip_crypto.c