From patchwork Tue Apr 4 21:09:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9662591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6739760352 for ; Tue, 4 Apr 2017 21:09:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595AD28581 for ; Tue, 4 Apr 2017 21:09:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E1E52859E; Tue, 4 Apr 2017 21:09:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAFA228581 for ; Tue, 4 Apr 2017 21:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=J8Kh6TSFaXYfNL7nqLHcFJ4hZl8INNUVCMjo1sNbNU0=; b=W+B T6I9lHpTQNwMVfS+nBqqqJq6YexFLwu1gcG93npnoJuzg0jC2gPrFZ7wyxHVkDsJHQfmLuBsokJof bukt1NOmU+RAe8xUIYSN0HH6zLfnV6aAPeCRm+F1Wo1s8HSm4Vd88dw04f8S6G9kT77l9p0X1RtE0 kwWnCIy4S2mUWsMm74uRe5rmFty0c929/vS3yxLAkYF8QBriEGehqofC0DjaH+rE5oH8vUEayr3+y yLOnz2b+X5kQbFeeqPzZDmcgDpYllm73W3BfL5QmR8hXxSTgQrOnxtGrIRbulerapiApE/031Vl3F YRMA96LkoKqI5PRz3euDP4mVFV4zRgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cvVhq-0007A2-26; Tue, 04 Apr 2017 21:09:38 +0000 Received: from mail-qk0-f170.google.com ([209.85.220.170]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cvVhl-00077w-La for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2017 21:09:35 +0000 Received: by mail-qk0-f170.google.com with SMTP id h67so54616602qke.0 for ; Tue, 04 Apr 2017 14:09:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rJYBdY9s0WeuF6S1hvWqsVKBpAv02L0IyjCgJ9TInrc=; b=GxsHNJi3XwWf40Yqeh3TJBUAve5YkC9oO5dV5io/P41ap+KF0pxvP2nT3uGkrFPXXx tbx7Rckpf8xG1aGK09oT0msDNJxvxCaMzpHjWfPbpplFoWHf6YS62wtGaCc/DiTlcdnm SoYVMq1N7XF7z/1ptXU8tXhR6EMVkjebM9wgRqGK43+odnsIC/yT/8t/Yj+8ISGVhsx8 FSjhAGUkUjp5yEfcmh/gs845H9grp9SxikTHqJpfQJUh3vC/XB63pc25vy6vq/yuv9Oc vZhyU412nOjeLxu965eHr8gyPv2LdEuqwNB7mhejU07U7/dmixvAbSbIN6HEV/Z8EqcX yizQ== X-Gm-Message-State: AFeK/H1SE3Vlg/GZ3G1EH4OlDcULPfIM962h0h/vTNdJRx9+EaPo1yCoEIo7e26mUTX1zGa4 X-Received: by 10.55.108.131 with SMTP id h125mr22961610qkc.199.1491340151476; Tue, 04 Apr 2017 14:09:11 -0700 (PDT) Received: from labbott-redhat-machine.redhat.com ([2601:602:9802:a8dc:1722:8a6b:a66c:79eb]) by smtp.gmail.com with ESMTPSA id 1sm12671704qkm.14.2017.04.04.14.09.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 14:09:10 -0700 (PDT) From: Laura Abbott To: Kees Cook Subject: [PATCH] mm/usercopy: Drop extra is_vmalloc_or_module check Date: Tue, 4 Apr 2017 14:09:00 -0700 Message-Id: <1491340140-18238-1-git-send-email-labbott@redhat.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170404_140933_787460_C02930CA X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-mm@kvack.org, Laura Abbott , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP virt_addr_valid was previously insufficient to validate if virt_to_page could be called on an address on arm64. This has since been fixed up so there is no need for the extra check. Drop it. Signed-off-by: Laura Abbott Acked-by: Mark Rutland --- I've given this some testing on my machine and haven't seen any problems (e.g. random crashes without the check) and the fix has been in for long enough now. I'm in no rush to have this merged so I'm okay if this sits in a tree somewhere to get more testing. --- mm/usercopy.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mm/usercopy.c b/mm/usercopy.c index d155e12563b1..4d23a0e0e232 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -206,17 +206,6 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n, { struct page *page; - /* - * Some architectures (arm64) return true for virt_addr_valid() on - * vmalloced addresses. Work around this by checking for vmalloc - * first. - * - * We also need to check for module addresses explicitly since we - * may copy static data from modules to userspace - */ - if (is_vmalloc_or_module_addr(ptr)) - return NULL; - if (!virt_addr_valid(ptr)) return NULL;