From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 87DB76B0272 for ; Tue, 6 Dec 2016 18:51:36 -0500 (EST) Received: by mail-qk0-f199.google.com with SMTP id g193so303046802qke.2 for ; Tue, 06 Dec 2016 15:51:36 -0800 (PST) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com. [209.85.220.179]) by mx.google.com with ESMTPS id 124si7805322qke.234.2016.12.06.15.51.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 15:51:35 -0800 (PST) Received: by mail-qk0-f179.google.com with SMTP id n21so397671056qka.3 for ; Tue, 06 Dec 2016 15:51:35 -0800 (PST) From: Laura Abbott Subject: [PATCHv5 10/11] mm/usercopy: Switch to using lm_alias Date: Tue, 6 Dec 2016 15:50:56 -0800 Message-Id: <1481068257-6367-11-git-send-email-labbott@redhat.com> In-Reply-To: <1481068257-6367-1-git-send-email-labbott@redhat.com> References: <1481068257-6367-1-git-send-email-labbott@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , Kees Cook Cc: Laura Abbott , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Marek Szyprowski , Joonsoo Kim , linux-arm-kernel@lists.infradead.org The usercopy checking code currently calls __va(__pa(...)) to check for aliases on symbols. Switch to using lm_alias instead. Reviewed-by: Mark Rutland Tested-by: Mark Rutland Acked-by: Kees Cook Signed-off-by: Laura Abbott --- v5: No changes, just acks --- 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 ""; -- 2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org