From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF931C433B4 for ; Thu, 6 May 2021 12:05:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96254613D6 for ; Thu, 6 May 2021 12:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbhEFMG3 (ORCPT ); Thu, 6 May 2021 08:06:29 -0400 Received: from verein.lst.de ([213.95.11.211]:47473 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231560AbhEFMG2 (ORCPT ); Thu, 6 May 2021 08:06:28 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 883BC68AFE; Thu, 6 May 2021 14:05:26 +0200 (CEST) Date: Thu, 6 May 2021 14:05:26 +0200 From: Christoph Hellwig To: David Laight Cc: 'Andy Lutomirski' , Josh Poimboeuf , Al Viro , X86 ML , LKML , Linus Torvalds , Will Deacon , Dan Williams , Andrea Arcangeli , Waiman Long , Peter Zijlstra , Thomas Gleixner , Andrew Cooper , Christoph Hellwig , Mark Rutland , Borislav Petkov Subject: Re: [PATCH v4 3/4] x86/uaccess: Use pointer masking to limit uaccess speculation Message-ID: <20210506120526.GA1124@lst.de> References: <5ba93cdbf35ab40264a9265fc24575a9b2f813b3.1620186182.git.jpoimboe@redhat.com> <986301bcdc7c488d86dd5f11c988bf87@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <986301bcdc7c488d86dd5f11c988bf87@AcuMS.aculab.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 06, 2021 at 08:36:08AM +0000, David Laight wrote: > uaddr = access_ok(uaddr, size) access_ok as a public API is not interesting. There are very few valid uses cases for ever calling access_ok outside the usual uaccess helper. So leave access_ok alone, there is not point in touching all the callers except for removing most of them. If OTOH we can micro-optimize get_user and put_user by using a different variant of access_ok that seems fair game and actually useful.