Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1555942

[PATCHv7 06/11] mm/usercopy: Switch to using lm_alias

From Laura Abbott <labbott@redhat.com>
Newsgroups linux.kernel
Subject [PATCHv7 06/11] mm/usercopy: Switch to using lm_alias
Date 2017-01-10 22:40 +0100
Message-ID <sYcj8-6ul-51@gated-at.bofh.it> (permalink)
References <sYcj7-6ul-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 mm/usercopy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/usercopy.c b/mm/usercopy.c
index 3c8da0a..8345299 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -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>";
 
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv7 00/11] CONFIG_DEBUG_VIRTUAL for arm64 Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 11/11] arm64: Add support for CONFIG_DEBUG_VIRTUAL Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 06/11] mm/usercopy: Switch to using lm_alias Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 09/11] arm64: Add cast for virt_to_pfn Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 02/11] mm/cma: Cleanup highmem check Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 08/11] arm64: Move some macros under #ifndef __ASSEMBLY__ Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  [PATCHv7 10/11] arm64: Use __pa_symbol for kernel symbols Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100
  Re: [PATCHv7 00/11] CONFIG_DEBUG_VIRTUAL for arm64 Will Deacon <will.deacon@arm.com> - 2017-01-12 18:40 +0100

csiph-web