Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1123281ybz; Fri, 1 May 2020 15:09:25 -0700 (PDT) X-Google-Smtp-Source: APiQypJAC+foIHHw1d815KiRpcF18lzD1Et01XBHXrUAGD1UaOTg6V4e3rJPG1mKSVoGfddkgwO0 X-Received: by 2002:a17:906:2410:: with SMTP id z16mr5390488eja.1.1588370964846; Fri, 01 May 2020 15:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588370964; cv=none; d=google.com; s=arc-20160816; b=ygULBXUMy0U9xkWT/z5HrF3MxkqnPWbIi/MMvim8hrv8+lcDqCood1bY4sborffSVX M7JhuVvlGqYIbPK5CSPNcJ04/emTq25nZJnTx/5V/hsrecgQLITBgFenu0S6JiJKtBjb GMt2Z3SFoAbyKKCHMzTpKrJp2CVPNBoLshp9NCvEaGKZGq1KIb1RPNsJr4bE7ImNOvox DtZEEr54nDFcm/x2iHohtmZzmTvXTjjCSU1eHC/k5NfHRsG1NBh+tpf0rP/CjQiiN/z0 3qNoEkBCUszv7OtcVtmBgHXd6Kr80q7vs6n311uwLSottiFOEMsM1t5ep+mL0vuPwiUZ bHGg== 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=9RtkuzCfVHAgZTFvTOoIre9EoSM/mOGMBck2Ut97Jqw=; b=MAOzxcrTYLGzP80xQX7mI25xnxpmaRUac4owIxSMuuxPlfihvu0B5RlzG/M3KKNW8n lIMuY56JZpbkMKJCoo7Okfk5c/zWzI2rLND69FnBVGVJaTRzwJ3uWXNmH8UgFSjUFjiJ 1Q8ovHWB7nVe+XMtMfa2FI9d7k9dXh0fHaoLqlrWe6PnJ7Vuz0R2rqFdakWfgfiLtdX6 Azgx/Rh4k6iZuSInkEOAoxeonaSMVGYPW3dx/5z7339fKnuw2WwjF4dNhv5RCetkv5Ve hg/UjDfmyFOSt3A22Ez8uIkHfi0okzNpIjAsjNGHVWVhCx55RY15+sVfaF+ye9d8Fkq9 9tvw== 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 ga21si2490402ejb.350.2020.05.01.15.09.02; Fri, 01 May 2020 15:09:24 -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 S1726430AbgEAWEz (ORCPT + 99 others); Fri, 1 May 2020 18:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgEAWEy (ORCPT ); Fri, 1 May 2020 18:04:54 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D516C061A0C; Fri, 1 May 2020 15:04:54 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUdm5-00GG8t-Ej; Fri, 01 May 2020 22:04:49 +0000 Date: Fri, 1 May 2020 23:04:49 +0100 From: Al Viro To: Andrew Morton Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] exec: open code copy_string_kernel Message-ID: <20200501220449.GQ23230@ZenIV.linux.org.uk> References: <20200501104105.2621149-1-hch@lst.de> <20200501104105.2621149-3-hch@lst.de> <20200501141903.5f7b1f81fdd38ae372d91f0e@linux-foundation.org> <20200501213048.GO23230@ZenIV.linux.org.uk> <20200501144013.be5bf036ab7f2d2303676bce@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200501144013.be5bf036ab7f2d2303676bce@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 01, 2020 at 02:40:13PM -0700, Andrew Morton wrote: > On Fri, 1 May 2020 22:30:48 +0100 Al Viro wrote: > > > On Fri, May 01, 2020 at 02:19:03PM -0700, Andrew Morton wrote: > > > On Fri, 1 May 2020 12:41:05 +0200 Christoph Hellwig wrote: > > > > > > > Currently copy_string_kernel is just a wrapper around copy_strings that > > > > simplifies the calling conventions and uses set_fs to allow passing a > > > > kernel pointer. But due to the fact the we only need to handle a single > > > > kernel argument pointer, the logic can be sigificantly simplified while > > > > getting rid of the set_fs. > > > > > > > > > > I don't get why this is better? copy_strings() is still there and > > > won't be going away - what's wrong with simply reusing it in this > > > fashion? > > > > > > I guess set_fs() is a bit hacky, but there's the benefit of not having > > > to maintain two largely similar bits of code? > > > > Killing set_fs() would be a very good thing... > > Why is that? And is there a project afoot to do this? Long story - basically, it's been a source of massive headache too many times. No formal project, but there are several people (me, Arnd, Christoph) who'd been reducing its use. For more than a decade now, I think... FWIW, I doubt that it will be entirely killable; Christoph appears to be more optimistic. In any case, its use has been greatly reduced and having it narrowed down to even fewer places would be a good thing. In the same direction: use_mm()/unuse_mm() regularization wrt set_fs(), getting rid of it in coredump code, some movements towards killing ioctl_by_bdev(); not sure if I've spotted everything - Christoph?