Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp847455pxk; Thu, 1 Oct 2020 15:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTf/ebf6/F5BkxwXcNg1Jhm1IpPSj0FFbesEMGPzmqJ/zzhNDPovysdkwWzBthyWhDi3oK X-Received: by 2002:a17:906:a198:: with SMTP id s24mr10240528ejy.154.1601592153036; Thu, 01 Oct 2020 15:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601592153; cv=none; d=google.com; s=arc-20160816; b=MX05bM4HsTvuynjLhaOlRdUilzEjXvQS/3VEooOhh9T0B+ZYw+8t/RA4vLpTvkOa+a hX98rgzS+jpIc4m/Z5ugsBmy8Cv3G7sZqLs44cKIcRf4hSRlbgxz4OplcgehoOXMrRAx b1SJ3z+Xxaan1o65iWbdQMLxBK4YpEVIcaevhuEp5MViJCTkwCl7eqUzMuf/uKrU+vOy viNNRahQqvrcg/DcQ61dx/FMZgr+ON1yfioDjpBcJTb27Y8a+vP/R4pg+lvHzaiWrVsp bxKAG/NBIuo5I+089U0aB2NIb14YFA5xyFIXZVN3G9STLDVBumqa8V+Bbnz+QI2L7oYX ha3Q== 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=P4tDGZyklN1YjmEZ86UKtWXvhQY7WJFUsAGrMnj094k=; b=Xn5hVRXFrKxX6yWq3bUidK0eL/rG+Hua6sDzMArbwf3lBW88dLJY3+1pHZQdkbIe3r EeFCeP/2vbH24tbeazxxxMs6wlatM86fwhT35K5aNeCBES26pMDwM5ewXl3kRlHmKRZo YoGvCdoBwAzWjRIHxYa+Mj0aAoq6ryeDVk96ldw5meOZCBt8qQmFL/+NAzVzz2SdK/I3 69yKh7sNflem/vW/eh2TrJn/dRKUTQXMtS/0GAxR4fGf2K6H4LemFEGVpQ9GiT7AwwbX 696DHPY5igJF6ryM2096rF1wYWMuRQUKfpT8XnLz0/jTrNvHz2Gd4SPQ37lncbShPZjX ppjg== 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 k2si4419861edx.169.2020.10.01.15.42.09; Thu, 01 Oct 2020 15:42:33 -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 S1733131AbgJAWlF (ORCPT + 99 others); Thu, 1 Oct 2020 18:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbgJAWlE (ORCPT ); Thu, 1 Oct 2020 18:41:04 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA59C0613D0; Thu, 1 Oct 2020 15:41:03 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO7Fr-00A5Qh-PX; Thu, 01 Oct 2020 22:40:51 +0000 Date: Thu, 1 Oct 2020 23:40:51 +0100 From: Al Viro To: Eric Biggers Cc: Christoph Hellwig , Linus Torvalds , Michael Ellerman , x86@kernel.org, Alexey Dobriyan , Luis Chamberlain , Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 05/14] fs: don't allow kernel reads and writes without iter ops Message-ID: <20201001224051.GI3421308@ZenIV.linux.org.uk> References: <20200903142242.925828-1-hch@lst.de> <20200903142242.925828-6-hch@lst.de> <20201001223852.GA855@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201001223852.GA855@sol.localdomain> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 03:38:52PM -0700, Eric Biggers wrote: > mutex_lock(&sbi->pipe_mutex); > while (bytes) { > - wr = __kernel_write(file, data, bytes, NULL); > + wr = __kernel_write(file, data, bytes, &file->f_pos); Better loff_t dummy = 0; ... wr = __kernel_write(file, data, bytes, &dummy);