Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2586182pxu; Sat, 10 Oct 2020 00:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY8m1mnBURyHV9UExmUJcwQ9WjWY8+ADR3FCQVy+AvUeTjYnSUxeBUWsI6q9+xUMvWYU+x X-Received: by 2002:a17:906:cf9d:: with SMTP id um29mr17792274ejb.307.1602313864848; Sat, 10 Oct 2020 00:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602313864; cv=none; d=google.com; s=arc-20160816; b=mQDSqPEL6qKzvfHEJWKASgoSBo5IlNAcqLM/qOOsgrdGckNDlYqexLrUMc9hzPXf7y 0XuDg3NkEXT5ES3Ldt+VJJez8tCIWrih6jfAYWUZZPC4LGY3GxZF/czxbtrX6+cOwHqo JeKQrAawn6LiaL/nlcHIjK+gPg3NY08n97cD9I1PTwPqwRaRn96jUoHjbTwrxvfaW8Ej tpKnIT9FZpCPVeGWFUJFqMG0v/7Gyo2t/b2AlDmWOSFYVJDRgu8/v1bH0Xg3jweqESxd JCILVOePfLrkw4EbtHGU3I8nNam6cqY3+E9n5Y5GLekZqN7jze84sUIZlvOrP+62hbBc 1deA== 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=s7OwKgWi2gSxmEp/hYxtSzWSpApJcXjT+OdSqNt7VYU=; b=jbhAPLxYWPFz8xz0XVEKZ/r+8LD2Q1A7mN/t2PUF9VSv+sGVfr9MorsTMFDJVSXnOx wreUvI+sHh4jkO/FiczwdmGMJ0ikncjLtS5pRdOboJqKZ23dX9N46YpKsSwOckegYYJZ PRbyuM2BnPW8umzQ8H1R0J+fy1wn0Q4VB87b/J8Fdbcp+d6UZpIhrf2f/UGgkOQqOmwT aME0JVxMnPZYcYytsWuEcbD8RDfyMbVRv3UpXDeJS/TrqvIUk0o5WOW3d20DKWFbRm6/ /h+chYl+sT70SrLPUGlt086/lv03V3iSOZuui8E76YAp+4DXQeDDuzELaXsasSzNBUsy 5ykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Wf1q2lnu; 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 bu15si7577086ejb.548.2020.10.10.00.10.39; Sat, 10 Oct 2020 00:11:04 -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=Wf1q2lnu; 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 S1729470AbgJJBK4 (ORCPT + 99 others); Fri, 9 Oct 2020 21:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729353AbgJJBEG (ORCPT ); Fri, 9 Oct 2020 21:04:06 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79A0C0613DB for ; Fri, 9 Oct 2020 18:03:51 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id a9so12521937lfc.7 for ; Fri, 09 Oct 2020 18:03:51 -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=s7OwKgWi2gSxmEp/hYxtSzWSpApJcXjT+OdSqNt7VYU=; b=Wf1q2lnubIrbXjk14tkrYxXcbBXmzq9qYbXL1Q2p8EB+0CvkKSqF+3HlgfvaB+X8S6 SG17cHHpnVFX880L11ZWENbR0ebhET03jaC+x724GDZbfQvjLR0+JYp1fVD8FDqLvksZ kRBaHY97weaJ2iFk9krv7PVK7ymwvLjzNkwFU= 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=s7OwKgWi2gSxmEp/hYxtSzWSpApJcXjT+OdSqNt7VYU=; b=J3Uu3sVX6pFAzNXghglpC6e/i/A/EdAHS5L8PidcCaB2ulBYC3F5RMLuSRn02Lf2LY RWi+wHOenkTg+PaQrkfTu5oM2vQz55LXMdmuZ30mk5rYbJcnmgAlml4Y4W2K3+DCFMDz 6VNBRTTYq8y8c/2cqryoD2qFRTLlOFhiB110IEGVoIHI1+ssZoMQ2sJNkVjHapQ4HO8B SbHk1p9Y5R6t8McaE7CpscJaMEDmcnIK+3bz3SnG0vTIgPfb/S6rgyGCEoR9WJ3zFEjl y8zyD/RCXhePkuwS3GyhOUVdBtDmNIYpQzuiIve5hzfZknmzlbqQw57gRULnLW64isrF DXlA== X-Gm-Message-State: AOAM531NS7wO2YKqAyJzhJJ9Pn03wlr0dq1iTYtiQ0b1JFLAED+IllWE KVkh4mfof7A8jt3GVbW+HMmKb1bQkznIZQ== X-Received: by 2002:a19:2291:: with SMTP id i139mr4871459lfi.387.1602291829782; Fri, 09 Oct 2020 18:03:49 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id j20sm1832666lfe.181.2020.10.09.18.03.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 18:03:48 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id y16so10103387ljk.1 for ; Fri, 09 Oct 2020 18:03:47 -0700 (PDT) X-Received: by 2002:a2e:2202:: with SMTP id i2mr5735571lji.70.1602291827290; Fri, 09 Oct 2020 18:03:47 -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> In-Reply-To: <20201009220633.GA1122@sol.localdomain> From: Linus Torvalds Date: Fri, 9 Oct 2020 18:03:31 -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 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 3:06 PM Eric Biggers wrote: > > It's a bit unintuitive that ppos=NULL means "use pos 0", not "use file->f_pos". That's not at all what it means. A NULL ppos means "this has no position at all", and is what we use for FMODE_STREAM file descriptors (ie sockets, pipes, etc). It also means that we don't do the locking for position updates. The fact that "ki_pos" gets set to zero is just because it needs to be _something_. It shouldn't actually ever be used for stream devices. Linus