Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17676987ybl; Thu, 2 Jan 2020 09:54:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzxiP+u6Y+MA6Co9E34k2LDoz0RQKzCY/H2qzSJl1D4Js3I0716qTHx+tHoPkxLDocDzl1X X-Received: by 2002:a9d:6516:: with SMTP id i22mr75403361otl.94.1577987649425; Thu, 02 Jan 2020 09:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577987649; cv=none; d=google.com; s=arc-20160816; b=gBGpfDJZ/ljAdULItdQfgmYiZ0KaUwOYGKx17443q6a52OZYKqnx4BC3795elbZYqR ii4elGHt9QqRtVFmYf5VdbPBdNw0IVMvcuZh2Epoiv2TWDZFawInLKGlo8z5rofl4/bP GBqyB67qhCiUMqj3WSKXamRJOY1Q0ClaohA2Aaxk87IafkofEtYR4bhAK3JomhvYA+dm IdK3wm1EzeEFGB2ar9F/L6anXadP0r/U7il11vEnnvUpoTLE+YgjhgKDvseW4hkzaee2 oEV9Ij3L+rEY0M0x+Mz44pzwv5qFf2MQ8962E0hb33BKYHOf4o6O8jtVlcLHcFfefR70 Viaw== 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=CbjtRNrDSxg9TAcsDtNGBcAznhxaOcRZ9tN4f0DmsV4=; b=aFJMkDoiKo7kqFo5AbJP8FCzpyulQH++lFjYEgBBbTUAVmm6taK4ueQepJnLUxK6pZ N0nuKkW2tptBnSWkNy1hUIEly+poRKFZ5aRzwJRqPSsiqUZIYrytCkkJ8W2nICKHp0vD H3OayLMqceT30/XTBnYHxuWK2oXbt+kygT2E6AWLsOyV82t987MYdPGcQrK6+Hf3rqw6 0I2eA5Jg6OEgtXwrqeCnBlwhgQgAisAp0tru7RkDMGH2wJJ6uQs7UFZKuSiEXJWac+LV 6qf6XLcHVEnKDVvxh3y9rToA/0WMtNsGjZOS5XCdhVtCjDPefStve+DIX6j1ms61jQla YQQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e59si30632005ote.97.2020.01.02.09.53.56; Thu, 02 Jan 2020 09:54:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727891AbgABRxG (ORCPT + 99 others); Thu, 2 Jan 2020 12:53:06 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:34354 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727706AbgABRxG (ORCPT ); Thu, 2 Jan 2020 12:53:06 -0500 X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from light.dominikbrodowski.net (brodo.linta [10.1.0.102]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 001622006F1; Thu, 2 Jan 2020 17:53:04 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id 40C7B20343; Thu, 2 Jan 2020 18:53:00 +0100 (CET) Date: Thu, 2 Jan 2020 18:53:00 +0100 From: Dominik Brodowski To: Linus Torvalds Cc: Arvind Sankar , Linux Kernel Mailing List , Al Viro , youling 257 Subject: Re: [PATCH] early init: open /dev/console with O_LARGEFILE Message-ID: <20200102175300.GA292871@light.dominikbrodowski.net> References: <20191231150226.GA523748@light.dominikbrodowski.net> <20200101003017.GA116793@rani.riverdale.lan> <20200101183243.GB183871@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 01, 2020 at 01:39:00PM -0800, Linus Torvalds wrote: > I'm not saying that the revert is wrong at this point, Linus, I'd like you to revert the patch nonetheless -- it was quite broken, it is still broken and probably needs, besides your fix, the O_LARGEFILE patch I sent out a few days ago. What is more, I think a different approach is saner, leads to smaller code, and creates far less risks. And maybe Al Viro likes it a bit more as well :) At https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git ksys-next there are a few proof-of-concept patches for three in-kernel-syscalls: (1) Both ksys_open() and ksys_unlink() can trivially operate properly on a kernelspace pointer (by means of calling getname_kernel() instead of getname()), such as: -static inline long ksys_unlink(const char __user *pathname) +/* note: operates on a kernelspace pointer to pathname */ +static inline long ksys_unlink(const char *pathname) { - return do_unlinkat(AT_FDCWD, getname(pathname)); + return do_unlinkat(AT_FDCWD, getname_kernel(pathname)); } (with all callers of ksys_unlinked() checked, of course). (2) For ksys_mkdir(), we already have a fully vfs-in-kernelspace variant in devtmpfs::dev_mkdir(), which we can use for ksys_mkdir() as well. What do you (and others) think of these alternative approaches? If we should work in this direction, please revert the patch -- the new patches should go into v5.6 at earliest, and probably be routed via Al Viro (unless he and/or you want me to have this tree managed independently, and included in linux-next separately). Thanks, Dominik