]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
parisc: Check region is readable by user in raw_copy_from_user()
authorJohn David Anglin <dave.anglin@bell.net>
Mon, 21 Jul 2025 19:39:26 +0000 (15:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:37 +0000 (16:28 +0200)
commitb334724f6b315f8bc78471520df6f92d2e8b8328
treee7960c742b6c934fd27b65a80245bc47136f86f7
parentfe0886c98b63523a47da079cd52dc9880533ed98
parisc: Check region is readable by user in raw_copy_from_user()

commit 91428ca9320edbab1211851d82429d33b9cd73ef upstream.

Because of the way the _PAGE_READ is handled in the parisc PTE, an
access interruption is not generated when the kernel reads from a
region where the _PAGE_READ is zero. The current code was written
assuming read access faults would also occur in the kernel.

This change adds user access checks to raw_copy_from_user().  The
prober_user() define checks whether user code has read access to
a virtual address. Note that page faults are not handled in the
exception support for the probe instruction. For this reason, we
precede the probe by a ldb access check.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/include/asm/special_insns.h
arch/parisc/lib/memcpy.c