Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp19535ybm; Wed, 27 May 2020 17:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlZ37kKVCG2t0j8V3WLLd6i/PFvI4RRs0NoFVgb4tnmyyEihDWYx9gHXI8eqE2iiOmjd1B X-Received: by 2002:a17:906:cd18:: with SMTP id oz24mr817776ejb.179.1590627489797; Wed, 27 May 2020 17:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590627489; cv=none; d=google.com; s=arc-20160816; b=PSTUksRdLMlj0Luolc2NgRgbq1nDNISbB+nY6XKLOZTyasiDcaoT10qtxYkeuDRguz ck3rO/M9wGAmmaEsmENo+EmnlvWLS9ksw5qAXCRpzHrcgv5eE1UjRw20HsAtEMUVsWfJ KaVtplQVZNJgo+8Zl9KcB3PhjDgYQA33wgFG4MsNJX8uy3YEokZ6m9HwJeMPgKLNEflD a1rJPXQeRQAJhVfqD7agxehY/tgF130UaggsdlFzLEahqiKyzUFvoCtXTJw/KY1UxU1k 7GXMLGiE7vcc6g018jniwn6DrRurw8LUrGvrSvc3HzAnZNQtOgqbU+ifmBsNdPEfKFjP SqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WzG31ZXPKnk4AQKLjBo8gGjllK91LDea1XQT/LCRIb0=; b=1HZZCYdiCb0QAbeWVp2K8MeFp4A2uABUJz4X0NvrwDKFRqGZMTg/B7cXuhnhxALZVe uCwCbgLt9q8agFkY+sKBlbhPxhwCHv7Hfx86xvEXxs/P+nVx2R1/aD3bQFz/JvPaaGTO PFLW3hlqd2uS2j5Yi/0SgazjLk8ogMGWtrT7hiCq+Oi9FmIZL8A7fKHvNTrp6Gltv8xO OgfU1XfR1WK8ac9ydkBh7WrKICRb+8HYCgbbJm+GUW+sEJn5MC9STRf7uzcLi2qcemLm ni5I6bzUn4g8OTKAoZUrBhIi+Yj7k85GABNak/PnI3ZF/66Bebkc0zHtLpbd+31+zeZP Vb0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jv37Devl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si2440952ejb.273.2020.05.27.17.57.43; Wed, 27 May 2020 17:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jv37Devl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725883AbgE1Azs (ORCPT + 99 others); Wed, 27 May 2020 20:55:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:35114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgE1Azs (ORCPT ); Wed, 27 May 2020 20:55:48 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A70B8207CB; Thu, 28 May 2020 00:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590627348; bh=LVt+v07eAhhKUzT7NqWt/6bOrLAfS45SVvYmNSlojo4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jv37DevlwxDmCOqr9Zb5+P2Xeq5ZWKgzCjORE0J9RBB7bJfqb3n8CvDivIWERcESE VM38R5KdZwFEAuJzap4U8cYrCW2Bkn8bZDTrxsIVze5ZoSzUpmeMIKrR/RqWTuadrt WomSlE/Kd+KPBoOd1wYzuXZRNXU+tR00icpmem+o= Date: Wed, 27 May 2020 17:55:47 -0700 From: Andrew Morton To: Christoph Hellwig Cc: x86@kernel.org, Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Linus Torvalds , linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/23] maccess: unify the probe kernel arch hooks Message-Id: <20200527175547.0260fb90d76734d4e0f56def@linux-foundation.org> In-Reply-To: <20200521152301.2587579-11-hch@lst.de> References: <20200521152301.2587579-1-hch@lst.de> <20200521152301.2587579-11-hch@lst.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 May 2020 17:22:48 +0200 Christoph Hellwig wrote: > Currently architectures have to override every routine that probes > kernel memory, which includes a pure read and strcpy, both in strict > and not strict variants. Just provide a single arch hooks instead to > make sure all architectures cover all the cases. Fix a buildo. --- a/arch/x86/mm/maccess.c~maccess-unify-the-probe-kernel-arch-hooks-fix +++ a/arch/x86/mm/maccess.c @@ -29,6 +29,6 @@ bool probe_kernel_read_allowed(const voi { if (!strict) return true; - return (unsigned long)vaddr >= TASK_SIZE_MAX; + return (unsigned long)unsafe_src >= TASK_SIZE_MAX; } #endif _