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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9F1B1C433DF for ; Tue, 2 Jun 2020 17:46:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88C6F206E2 for ; Tue, 2 Jun 2020 17:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbgFBRqd (ORCPT ); Tue, 2 Jun 2020 13:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgFBRqc (ORCPT ); Tue, 2 Jun 2020 13:46:32 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62A16C05BD1E; Tue, 2 Jun 2020 10:46:31 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jgAzX-0023OX-8D; Tue, 02 Jun 2020 17:46:23 +0000 Date: Tue, 2 Jun 2020 18:46:23 +0100 From: Al Viro To: Linus Torvalds Cc: Jason Wang , "Michael S. Tsirkin" , Linux Kernel Mailing List , Netdev Subject: Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok() Message-ID: <20200602174623.GO23230@ZenIV.linux.org.uk> References: <20200602084257.134555-1-mst@redhat.com> <20200602163306.GM23230@ZenIV.linux.org.uk> <20200602174430.GN23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200602174430.GN23230@ZenIV.linux.org.uk> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jun 02, 2020 at 06:44:30PM +0100, Al Viro wrote: > On Tue, Jun 02, 2020 at 10:18:09AM -0700, Linus Torvalds wrote: > > > > You have exactly two cases: > > > > (a) the access_ok() would be right above the code and can't be missed > > > > (b) not > > (c) what you really want is not quite access_ok(). > > Again, that "not quite access_ok()" should be right next to STAC, and > come from the same primitive - I'm not saying the current model is > anywhere near sane. We need a range-checking primitive right next > to memory access; it's just that for KVM and vhost we might want > a different check and, for things like s390 and sparc (mips as well, things like vhost on s390 and sparc, that is. > in some configs), potentially different part that would do the memory > access itself as well.