Skip to content
Commit 9648d760 authored by Alban Crequy's avatar Alban Crequy Committed by Greg Kroah-Hartman
Browse files

maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault()



commit 8678ea06 upstream.

If a page fault occurs while copying the first byte, this function resets one
byte before dst.
As a consequence, an address could be modified and leaded to kernel crashes if
case the modified address was accessed later.

Fixes: b58294ea ("maccess: allow architectures to provide kernel probing directly")
Signed-off-by: default avatarAlban Crequy <albancrequy@linux.microsoft.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Tested-by: default avatarFrancis Laniel <flaniel@linux.microsoft.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> [5.8]
Link: https://lore.kernel.org/bpf/20221110085614.111213-2-albancrequy@linux.microsoft.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdd57c20
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment