Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2592889pxu; Sat, 10 Oct 2020 00:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRzTRVfXQo4GZEG7TYcXI0ANeVrLTXjg+w+DrLGkwX+M7RHFmRHJdIQKLVZEzx2/BzmMjp X-Received: by 2002:a17:906:2dd:: with SMTP id 29mr18711724ejk.31.1602314854949; Sat, 10 Oct 2020 00:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602314854; cv=none; d=google.com; s=arc-20160816; b=YYqfJgakuluz6Uj7D5Ah0EstmEsURLNVXeH2EfZMYhQ8pdkXK5JcZ38/XgC5LlO542 ckoYk0sgUVsh3B44+ybpxqTTtfcM3pk/J0mtolJrUOy5mGeQy3YXgt8MHQmkEuria23a UQSHKvhJ15lbioFQv8BwkAD3tB3NJbeBJga0cPDkXBDckOr/Fd9ICcKSAi95bviXm2Kx gKcQe+m2E2ValPL6YgSq+RjcbcNgye88jARNkvsfCvASiFj5Z7/ech/NIEm3OKRzDGAa 3JCwR5Q9korIijFAOJrdJWjZVSwo2Vz52cGKgkhQ1Ei9hf8XJlY5rs0I5qXc0d2rWmIe 5Zig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TL4cwcC3oy9yGXrCPN5M4+HoSQktOSj4hTD8XUaFtsk=; b=bGrLdIvvpwuDJKSfiGvvZ+1oDHhyhEEZavZU02i3i2cf7lSDoalJ3dt29n39GPhjth pA3GwTpLa5GukPZ+czhiLQVwMVVWCMv9AlEMm6I2aPpXImT9KcXuXZYx1ceSr5h9aTNj LjhOKHE19gLiYFik+CLqxXLq9F6Rwhca3dqjHXvtNTeUOsJd2oAO1sj22/qxKCbJ65rn LGrimxWqv3oqRPKmwMjdgnPt44IFivG+CevKvedFwrIgUzl5FjY5AXn7J7zjvBBOSLuw SG+M9slXj3OMxfk0Al4SsIZyonrwSlLzZnTKhHqLWWQkE6cwmi/Ua1WhrJDvh0QQ1vcr wp/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QUiZW7sc; 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 bz2si7849896ejc.47.2020.10.10.00.27.10; Sat, 10 Oct 2020 00:27:34 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QUiZW7sc; 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 S1729982AbgJJBw0 (ORCPT + 99 others); Fri, 9 Oct 2020 21:52:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729238AbgJJB3e (ORCPT ); Fri, 9 Oct 2020 21:29:34 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711A0C0613D0 for ; Fri, 9 Oct 2020 18:29:33 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id h20so11283727lji.9 for ; Fri, 09 Oct 2020 18:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TL4cwcC3oy9yGXrCPN5M4+HoSQktOSj4hTD8XUaFtsk=; b=QUiZW7sc85a+dF87QrbXxq2KTodKggKcduyYT3bL6iRpsp3sgK+dJqXe00Rkr1oRmE 0Q8iGj6Eoh8nHgmhwmUz1o2eQQJjkWTB80i7gsGyB9/jzaKGM86w97n/T1/Qg4RgrKKx Q30PjASdGXDKOZ6VrsgGinXqAdW3g6MlMxMzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TL4cwcC3oy9yGXrCPN5M4+HoSQktOSj4hTD8XUaFtsk=; b=h9Z5VBUcAcwIJoXqKjjnvUvjBeD2oJkiT6GG3ajgRx8HfMwgJx6nf1Qaml4TV8bKsb wVcXc2H2qus6HHu2PiGHMNxIqEAyeiTe/aoGijCGJs6HCtbjkCFFL8zdJ47A/mU4QOYg NiZvx3i03RMfkMCzsvDI1Y8IVU4O8WngD3OpyYhe2odmS5bv4/eHkGD0VF8/99OG+nOQ Sh8PlpdSCh2Z+U1onhMxiqEim942NYY+VIXvwCHG8U/xafhr8pMB/l0jJpvDp1Gb0BYk UpCVxE93zZnrGg7kIVVAjqMoFl3gamf9Qn/VfZHVfV2uxZC6ErOuha5X6MRtr3XjMXJ5 7Vrg== X-Gm-Message-State: AOAM532Sclcjs1NtOHp1fPcrMZvCq5I+XLE3br+yDUfDWS79Q1WgIVLK Y6sCws67lpeRxoxNx1dleVKuBHBg5fpKoA== X-Received: by 2002:a2e:9cc5:: with SMTP id g5mr5943902ljj.86.1602293370679; Fri, 09 Oct 2020 18:29:30 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id s20sm1799232lfs.135.2020.10.09.18.29.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 18:29:29 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id d24so8315194ljg.10 for ; Fri, 09 Oct 2020 18:29:29 -0700 (PDT) X-Received: by 2002:a2e:9152:: with SMTP id q18mr5731594ljg.421.1602293368914; Fri, 09 Oct 2020 18:29:28 -0700 (PDT) MIME-Version: 1.0 References: <20200903142242.925828-1-hch@lst.de> <20200903142242.925828-6-hch@lst.de> <20201001223852.GA855@sol.localdomain> <20201001224051.GI3421308@ZenIV.linux.org.uk> <20201009220633.GA1122@sol.localdomain> <20201010011919.GC1122@sol.localdomain> In-Reply-To: <20201010011919.GC1122@sol.localdomain> From: Linus Torvalds Date: Fri, 9 Oct 2020 18:29:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 05/14] fs: don't allow kernel reads and writes without iter ops To: Eric Biggers , Alexander Viro Cc: Al Viro , Christoph Hellwig , Michael Ellerman , "the arch/x86 maintainers" , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Linux Kernel Mailing List , linux-fsdevel , linux-arch , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 9, 2020 at 6:19 PM Eric Biggers wrote: > > Okay, that makes more sense. So the patchset from Matthew > https://lkml.kernel.org/linux-fsdevel/20201003025534.21045-1-willy@infradead.org/T/#u > isn't what you had in mind. No. That first patch makes sense - it's just the "ppos can be NULL" patch. But as mentioned, NULL isn't "shorthand for zero". It's just "pipes don't _have_ a pos, trying to pass in some explicit position is crazy". So no, the other patches in that set are a bit odd, I think. SOME of them look potentially fine - the bpfilter one seems to be valid, for example, because it's literally about reading/writing a pipe. And maybe the sysctl one is similarly sensible - I didn't check the context of that one. But no, NULL shouldn't mean "start at position zero, and we don't care about the result". Linus