diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-09-11 22:40:03 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-09-19 14:26:56 +0300 |
commit | ecc53818f60447177e24ea11b7f136c405150976 (patch) | |
tree | 11faff71cc0ad2c37aba56955510388fad458c32 | |
parent | 4b440e01da51da0cc651c06a036b8914b7b61ccf (diff) | |
download | linux-ecc53818f60447177e24ea11b7f136c405150976.tar.xz |
s390/ctlreg: add type checking to __local_ctl_load() and __local_ctl_store()
Add type checking to __local_ctl_load() and __local_ctl_store(). For
both functions enforce to pass an array consisting of unsigned longs.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r-- | arch/s390/include/asm/ctlreg.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/include/asm/ctlreg.h b/arch/s390/include/asm/ctlreg.h index e60c672ffb9c..a49459adba9d 100644 --- a/arch/s390/include/asm/ctlreg.h +++ b/arch/s390/include/asm/ctlreg.h @@ -45,6 +45,7 @@ \ _esize = (_high - _low + 1) * sizeof(unsigned long); \ BUILD_BUG_ON(sizeof(struct addrtype) != _esize); \ + typecheck(unsigned long, array[0]); \ asm volatile( \ " lctlg %[_low],%[_high],%[_arr]\n" \ : \ @@ -63,6 +64,7 @@ \ _esize = (_high - _low + 1) * sizeof(unsigned long); \ BUILD_BUG_ON(sizeof(struct addrtype) != _esize); \ + typecheck(unsigned long, array[0]); \ asm volatile( \ " stctg %[_low],%[_high],%[_arr]\n" \ : [_arr] "=Q" (*(struct addrtype *)(&array)) \ |