Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1069433pxb; Thu, 17 Feb 2022 23:16:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQIOfFwg7louwLfHb4pqPeaBx8ihz6nbrCOQRKtdiXFfM9lyG9AkhVY+lGodsSNzWzk/fl X-Received: by 2002:a17:906:360a:b0:6a6:a997:8297 with SMTP id q10-20020a170906360a00b006a6a9978297mr5247189ejb.180.1645168586975; Thu, 17 Feb 2022 23:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645168586; cv=none; d=google.com; s=arc-20160816; b=I8BTk8uT3fy8cSFyc4GDtbZlQVvhf3iwOD5DFf+6ZMlFgSfDZdd50I8SGGzejdg7sp TjxQKtjnonRiAFcVo86hCcyrHZp90eUC/fYtpqWtXHoEXkjrw3bLF+HuBBqeFYW0CTIT rswhL465oNJTtraWWzVUNfmjZI4hXcVOKMmLXktqr/vBZN0y6xK3CgjcNZbwxevWhGn8 mxSdeOe9Cob9vvqjLP0KU08WDFgwAQjsGJ69JcSSRHKV9qKnVfy+waYMDp88z1DoaTy0 WqIp2LGcno8RUNjBbBaUYKVuB+7ZYZzV9Qw9IAdW0PSUwQv9/p8O3SG6zl6jL6EJdeSg cmxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=biBcnAP4EMiTcKwkdMlnkIX/YmqxRzw5nyXLFuLYm0I=; b=s+f8tw/N+BVRv2dO0jhWH+mNd+GnuRNDM5M7WcLx0cI6YoXDQifPjK25fvxJOLpSY1 Px0oxbrXu72wa0nGtgtii/uAI9eZRC5CY2NAaPSOcSI7kV7Vx9k6zJUp2kBjFsKsLUrH ccQSaTTGuuQjUz6cYU84ROD10NtAF9FhaHwk/geYH4F9xoZItBiEay/uENkW7Bq2AuHj dzlSOg2w6VM5Lq5YoVXzR4pwgo+dXgPucZiPqRTgr5eWpbArUIdh2tdaSv4c+O2JseHl ioWJpiOZdW7LP9BYZfAUv66GfY9sP6iVVQL2bbPTtc4QAWR0I+EFbHGourpSNX3q3ATY Yj+g== ARC-Authentication-Results: i=1; mx.google.com; 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 r18si3560359eje.674.2022.02.17.23.16.03; Thu, 17 Feb 2022 23:16:26 -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; 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 S231643AbiBRGgN (ORCPT + 99 others); Fri, 18 Feb 2022 01:36:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231211AbiBRGgI (ORCPT ); Fri, 18 Feb 2022 01:36:08 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DF353BBDB; Thu, 17 Feb 2022 22:35:53 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 4DEC168BFE; Fri, 18 Feb 2022 07:35:49 +0100 (CET) Date: Fri, 18 Feb 2022 07:35:49 +0100 From: Christoph Hellwig To: Arnd Bergmann Cc: Linus Torvalds , Christoph Hellwig , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, arnd@arndb.de, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux@armlinux.org.uk, will@kernel.org, guoren@kernel.org, bcain@codeaurora.org, geert@linux-m68k.org, monstr@monstr.eu, tsbogend@alpha.franken.de, nickhu@andestech.com, green.hu@gmail.com, dinguyen@kernel.org, shorne@gmail.com, deller@gmx.de, mpe@ellerman.id.au, peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, hca@linux.ibm.com, dalias@libc.org, davem@davemloft.net, richard@nod.at, x86@kernel.org, jcmvbkbc@gmail.com, ebiederm@xmission.com, akpm@linux-foundation.org, ardb@kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v2 14/18] lib/test_lockup: fix kernel pointer check for separate address spaces Message-ID: <20220218063549.GJ22576@lst.de> References: <20220216131332.1489939-1-arnd@kernel.org> <20220216131332.1489939-15-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220216131332.1489939-15-arnd@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, Feb 16, 2022 at 02:13:28PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > test_kernel_ptr() uses access_ok() to figure out if a given address > points to user space instead of kernel space. However on architectures > that set CONFIG_ALTERNATE_USER_ADDRESS_SPACE, a pointer can be valid > for both, and the check always fails because access_ok() returns true. > > Make the check for user space pointers conditional on the type of > address space layout. What is this code even trying to do? It looks extremly broken.