Skip to content

Commit 46f6236

Browse files
labbottwildea01
authored andcommitted
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: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 5c6a84a commit 46f6236

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/usercopy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ static inline const char *check_kernel_text_object(const void *ptr,
108108
* __pa() is not just the reverse of __va(). This can be detected
109109
* and checked:
110110
*/
111-
textlow_linear = (unsigned long)__va(__pa(textlow));
111+
textlow_linear = (unsigned long)lm_alias(textlow);
112112
/* No different mapping: we're done. */
113113
if (textlow_linear == textlow)
114114
return NULL;
115115

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

0 commit comments

Comments
 (0)