Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1550723ybm; Sat, 30 May 2020 12:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw51vemFJ/JFwwL+ARCfNjJavLnp/0dulcLzZ9arle12qeWO9q6NmCjHyMK0Nw/lZddMwGg X-Received: by 2002:a17:906:2a4d:: with SMTP id k13mr13388982eje.253.1590866962984; Sat, 30 May 2020 12:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590866962; cv=none; d=google.com; s=arc-20160816; b=SBbps9oa74hINKdu9mRggcdO4JK3mrQROvm51JjWKtm+KhVi3nsXHU2SCxnwKHIlKq R5O0gbV2QTvXL8hoTFH9CtIqy4fTCArgpFK/coLtmNPXvqWBA7A/DxyDOukWQz2h1I5B EPVG4TmDaHelqGn99g98AYBYu6VKTp+ZU2lqF1A+F2xt7qVdv1ktnYT5WQXBeB4Nadaa c84IsydF1eC1I5ZXiemZLM4xHZUTrHzzg8Hg2Dg8zNbfurFgcVdsxhJNgonZ5d31TcE2 UM/+ei9Pm5N8trabeuhAADI5/Bl30xMpKUPNlO/ZPkzUZNXlPYbMke7xUjbxIBjf6g7k 7B3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CXRm/lQy5JGj1P0VRL/W3xM+YeszQY2QaB/BemMTjUU=; b=L+oeo4Q6ac94eVMP6XbCMAFgwMKZRRYXMqDigBL2RTqD/H60ht2QorDFhKYpLr/aYt jV/eAA1YgB+A7ZiEEUnYhmBXaofBY8Ev/Lv3KAOUMvb3clEbjGy3aUfJ9qbXW9vRC2uA eH50xUYmXojJ/7mAc927sJH8jmqXkx776xi6mGpnwRvjIn7OcbJfP6C1Rai8WYskuzy+ Wb2a4q+wDXvEKiP07QbxEopbfE+OkqhRP4m0LwtY0PaIh3FfpJWnv9VvuqZe7GD88RTT GXhMNQ7UcW92a9kRjjmnFF+fdZTnSIAzXPvEjTtk3hFxyooarvYUbC9pzlmIW2qxxlNl jcsw== ARC-Authentication-Results: i=1; mx.google.com; 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 y1si7181862edi.491.2020.05.30.12.28.59; Sat, 30 May 2020 12:29:22 -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; 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 S1729299AbgE3T1U (ORCPT + 99 others); Sat, 30 May 2020 15:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbgE3T1U (ORCPT ); Sat, 30 May 2020 15:27:20 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D47E0C03E969; Sat, 30 May 2020 12:27:19 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jf78U-000YpY-D7; Sat, 30 May 2020 19:27:14 +0000 Date: Sat, 30 May 2020 20:27:14 +0100 From: Al Viro To: Linus Torvalds Cc: Paolo Bonzini , Linux Kernel Mailing List , linux-fsdevel , KVM list Subject: Re: [PATCH 8/9] x86: kvm_hv_set_msr(): use __put_user() instead of 32bit __clear_user() Message-ID: <20200530192714.GT23230@ZenIV.linux.org.uk> References: <20200528234025.GT23230@ZenIV.linux.org.uk> <20200529232723.44942-1-viro@ZenIV.linux.org.uk> <20200529232723.44942-8-viro@ZenIV.linux.org.uk> <20200530143147.GN23230@ZenIV.linux.org.uk> <81563af6-6ea2-3e21-fe53-9955910e303a@redhat.com> <20200530183853.GQ23230@ZenIV.linux.org.uk> <20200530191940.GS23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200530191940.GS23230@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 30, 2020 at 08:19:40PM +0100, Al Viro wrote: > On Sat, May 30, 2020 at 11:52:44AM -0700, Linus Torvalds wrote: > > > And I don't understand why you mention set_fs() vs access_ok(). None > > of this code has anything that messes with set_fs(). The access_ok() > > is garbage and shouldn't exist, and those user accesses should all use > > the checking versions and the double underscores are wrong. > > > > I have no idea why you think the double underscores could _possibly_ > > be worth defending. > > I do not. What I'm saying is that this just might be a beast different > from *both* __... and the normal ones. I'm not saying that this > __put_user() (or __clear_user(), etc.) is the right primitive here. > If anything, it's closer to the situation for (x86) copy_stack_trace(). ... and no, I'm not saying that copy_stack_trace() should stay with __get_user() either. It feels like we are lacking primitives needed to express that cleanly and copy_stack_trace() currently cobbles something up out of what we have. Which works for arch-specific code, but yes, that kind of thing is brittle for arch-independent places like virt/kvm; I wonder if e.g. s390 is really OK there.