]> git.ipfire.org Git - thirdparty/linux.git/commit
soc: hisilicon: kunpeng_hccs: Add the check for base address and size of shared memory
authorHuisong Li <lihuisong@huawei.com>
Wed, 28 Aug 2024 10:49:53 +0000 (18:49 +0800)
committerWei Xu <xuwei5@hisilicon.com>
Mon, 14 Oct 2024 08:54:48 +0000 (08:54 +0000)
commit3400c85f6400dc907d686d319faad25956ac4db1
treeebef5598f242fcf56343a6c248678c2bb684fc0b
parent0c811bd2721d219bd104e0dc1fa76deee5e04ae4
soc: hisilicon: kunpeng_hccs: Add the check for base address and size of shared memory

If the shmem_base_addr from PCCT is zero, hccs_register_pcc_channel will
return success. And then driver will access to illegal address when send
PCC command. In addition, the size of shared memory used for communication
between driver and platform is fixed, namely 64 Bytes which is
unchangeable. So add the verification for hardening code.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
drivers/soc/hisilicon/kunpeng_hccs.c