From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C51C2D0E4 for ; Mon, 16 Nov 2020 03:30:11 +0000 (UTC) Received: from vger.kernel.org (unknown [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC4C522263 for ; Mon, 16 Nov 2020 03:30:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC4C522263 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726561AbgKPD3t (ORCPT ); Sun, 15 Nov 2020 22:29:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgKPD3t (ORCPT ); Sun, 15 Nov 2020 22:29:49 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B79C0613CF; Sun, 15 Nov 2020 19:29:48 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1keVD4-006zpa-RU; Mon, 16 Nov 2020 03:29:43 +0000 Date: Mon, 16 Nov 2020 03:29:42 +0000 From: Al Viro To: Nathan Chancellor Cc: Linus Torvalds , Christoph Hellwig , Greg KH , Alexey Dobriyan , linux-fsdevel , Linux Kernel Mailing List , kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 1/6] seq_file: add seq_read_iter Message-ID: <20201116032942.GV3576660@ZenIV.linux.org.uk> References: <20201114055048.GN3576660@ZenIV.linux.org.uk> <20201114061934.GA658@Ryzen-9-3900X.localdomain> <20201114070025.GO3576660@ZenIV.linux.org.uk> <20201114205000.GP3576660@ZenIV.linux.org.uk> <20201115155355.GR3576660@ZenIV.linux.org.uk> <20201115214125.GA317@Ryzen-9-3900X.localdomain> <20201115233814.GT3576660@ZenIV.linux.org.uk> <20201115235149.GA252@Ryzen-9-3900X.localdomain> <20201116002513.GU3576660@ZenIV.linux.org.uk> <20201116003416.GA345@Ryzen-9-3900X.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116003416.GA345@Ryzen-9-3900X.localdomain> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 15, 2020 at 05:34:16PM -0700, Nathan Chancellor wrote: > Still good. > > Tested-by: Nathan Chancellor Pushed into #fixes > > BTW, is that call of readv() really coming from init? And if it > > is, what version of init are you using? > > I believe that it is but since this is WSL2, I believe that /init is a > proprietary Microsoft implementation, rather than systemd or another > init system: > > https://wiki.ubuntu.com/WSL#Keeping_Ubuntu_Updated_in_WSL > > So I am not sure how possible it is to see exactly what is going on or > getting it improved. Oh, well... Anyway, as a regression test it's interesting: #include #include #include #include main() { static char s[1024]; static struct iovec v[2] = {{NULL, 0}, {s, 1024}}; for(;;) { ssize_t n = readv(0, v, 2), m, w; if (n < 0) { perror("readv"); return -1; } if (!n) return 0; for (m = 0; m < n; m += w) { w = write(1, s + m, n - m); if (w < 0) perror("write"); } } } which ought to copy stdin to stdout; with this bug it would (on sufficiently large seq_file-based files) fail with "readv: Bad address" (-EFAULT, that is).