Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6865570rwb; Wed, 18 Jan 2023 10:17:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSuzn/mtwIqrC+juiaS41NNGzZ0FjpeLYR9rNapY6cjvOF2CBmuxHrYxOOAhQNbQxzwAv4 X-Received: by 2002:a17:902:bd83:b0:193:2bc9:eb25 with SMTP id q3-20020a170902bd8300b001932bc9eb25mr8229545pls.20.1674065821730; Wed, 18 Jan 2023 10:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674065821; cv=none; d=google.com; s=arc-20160816; b=qLkHpQ8jU6/XCUG0Fxhw6jzQTwzoIdbSB0Zu+SdvSf9Zzd5Al57IRigRy3UsAny0y/ hm2jBfxzDIPCZS6Tz5q82RUuIMjXzI3Joxo60CxzaRTr3wPusnvtDTY+qRRhzKbwFboI iT0q1JZBz+caG6DdRATpMVQDN7bcI8SMrX+22RAw5jHpqpLINkMHAwquJUxzYkmu20r6 HEQIiji7s+t54dVWTk/JQH6pRe+SS2yrGNY8JYeAfunsGoXjjN36toHTIjW9YFATiRlF SkwDKcAKo0U0NLSWRH/1WOxMKv14Ns/FAdojB7Hghdjz/GpjWsuZne21gUE/efqsrA8G VOgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NoQkT4bAeFUtKhReQlXOayJmOIx8fi/SsB/fWlbrzXQ=; b=ahvBDdk3na+QfMXw+3UzECqzZug9fd3oFdbVbiUjbkBl5qLjDZDgEJTzdduQhmHVBk uVWj1C5p+BnKO66NbU2CE04qVEh/wOjyAQT5EkAy2fR1oIXwhycHoCr7Mgm5jdLZ3Nts 7dYes2149u3AKGx2WjpDJ/b4S5/r0OForEIE2gQbenq4VnOWbs1buMY88ZbQB2+aaZMg Mh0He4ePjsOiqcRm3/tkmjYF/15yZTgWCCl+4FFBvGhQvm+KLUzjGa1nvcv/WTgwt+6X WOfgz4g+WQvyFh9EbK03aNiMXbzWmtVfrplG+sxZum+jUQRx6f6RrZRBlCXmt19F/YXd kePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BZ1vl+eV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij9-20020a170902ab4900b00189c05664e8si951570plb.563.2023.01.18.10.16.56; Wed, 18 Jan 2023 10:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BZ1vl+eV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbjARQtf (ORCPT + 45 others); Wed, 18 Jan 2023 11:49:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjARQt0 (ORCPT ); Wed, 18 Jan 2023 11:49:26 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6099E37F0D for ; Wed, 18 Jan 2023 08:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NoQkT4bAeFUtKhReQlXOayJmOIx8fi/SsB/fWlbrzXQ=; b=BZ1vl+eV0aBW85PIlSsd4uGqBn zc9sXI+JywLhi61h/6zxZmH5YXB+YjyJLjy3kJTCpZNv532AZv6O2seW9haxn5H3yUNdUB2sIi6xG wq8Eagx4eb7hsFFspIYUDGUr4WFEKICOhoh0mT2z053/9tXaMK+loxX5CKFrp/yu4PUP0OIAWccdZ RMYK9XXU7qBH4U17RS7XBBcFTPHqwkXxyAyTZeU6qOELe6Kc+dMD4k8qpgKqfVDgyHwQfXdIUmHcu rwhKR24bbsLqb2sUksVytStpMylNzI82SIls6q2BU/8Fk6Z3v0VwMDvEj+ncmvC8Oaal+hHaPbUAb 1MMovObA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pIBc3-0002uG-0r; Wed, 18 Jan 2023 16:48:35 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AE30230030F; Wed, 18 Jan 2023 17:48:59 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8E7B720A68C2A; Wed, 18 Jan 2023 17:48:59 +0100 (CET) Date: Wed, 18 Jan 2023 17:48:59 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: "Kirill A. Shutemov" , Dave Hansen , Andy Lutomirski , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv14 01/17] x86/mm: Rework address range check in get_user() and put_user() Message-ID: References: <20230111123736.20025-1-kirill.shutemov@linux.intel.com> <20230111123736.20025-2-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2023 at 07:59:21AM -0800, Linus Torvalds wrote: > We don't silence it - for a kernel address that turns into an all-ones > address, the the _ASM_EXTABLE() will still cause the -EFAULT due to > the page fault. > But it's not the high bit set case that is the problem here. Yes, and the explicit bad_get_user jump would not print the message and now with _UA removed it won't either (I seem to have my wires crossed just now). > The problem is a "positive" address that is non-canonical. > > Testing against TASK_SIZE_MAX would catch non-canonical addresses > before the access, and we'd return -EFAULT. > > But now that we don't test against TASK_SIZE_MAX any more, > non-canonical accesses will cause a GP fault, and *that* message is > what we want to silence. Right, but I was thinking that we'd explicitly allowed those because with LAM enabled we'd actually accept those addresses. > We'll still return -EFAULT, of course, we're just getting rid of the > > WARN_ONCE(trapnr == X86_TRAP_GP, > "General protection fault in user access. > Non-canonical address?"); > > issue that comes from not being so exact about the address limit any more. Ah indeed, so for !LAM we'd now print the message were we would not before (the whole TASK_SIZE_MAX+ range). OK, agreed.