From ecc53818f60447177e24ea11b7f136c405150976 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 11 Sep 2023 21:40:03 +0200 Subject: 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 Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- arch/s390/include/asm/ctlreg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') 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)) \ -- cgit v1.2.3