Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46f6236a authored by Laura Abbott's avatar Laura Abbott Committed by Will Deacon
Browse files

mm/usercopy: Switch to using lm_alias



The usercopy checking code currently calls __va(__pa(...)) to check for
aliases on symbols. Switch to using lm_alias instead.

Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarLaura Abbott <labbott@redhat.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 5c6a84a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -108,13 +108,13 @@ static inline const char *check_kernel_text_object(const void *ptr,
	 * __pa() is not just the reverse of __va(). This can be detected
	 * and checked:
	 */
	textlow_linear = (unsigned long)__va(__pa(textlow));
	textlow_linear = (unsigned long)lm_alias(textlow);
	/* No different mapping: we're done. */
	if (textlow_linear == textlow)
		return NULL;

	/* Check the secondary mapping... */
	texthigh_linear = (unsigned long)__va(__pa(texthigh));
	texthigh_linear = (unsigned long)lm_alias(texthigh);
	if (overlaps(ptr, n, textlow_linear, texthigh_linear))
		return "<linear kernel text>";