s390/uaccess: Prevent kprobes on cmpxchg_user_key() functions
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 16 Jun 2025 15:00:32 +0000 (17:00 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Sun, 29 Jun 2025 11:12:02 +0000 (13:12 +0200)
commitd2b73ce90a7141d5aa34a52de82d69fbb68efc30
tree1f2f759500a1d4f59a94907375deb19e7933c3ef
parentb13c190c6da49043c55708cd62419d762744af18
s390/uaccess: Prevent kprobes on cmpxchg_user_key() functions

Code regions within cmpxchg_user_key() functions may be executed with a
non-default access key, which may lead to a protection exception if the
corresponding page has the fetch-protection bit enabled.

There is code in place which initializes the storage keys of such pages
when needed. However there is also the possibility of out-of-line execution
of such code in case a kprobe is set within such a region.

To avoid this problem prevent that any kprobe can be set within the
cmpxchg_user_key() functions.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/lib/uaccess.c