Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp709665pxb; Sat, 21 Aug 2021 16:14:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4vSV7U4M7t3altifIwFu4UqZA7TV41vMABHozlJIKPqmJSxj5lFSeU8zHdcXI1Yu+NRLU X-Received: by 2002:a5d:9ad0:: with SMTP id x16mr21763220ion.182.1629587676582; Sat, 21 Aug 2021 16:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629587676; cv=none; d=google.com; s=arc-20160816; b=P/qaeR7ce/XBoYNIqTMcTS90X1u8SBIlkuwaBc1LH7AMUbmlnnTdZJrvg2qnKCGlPt n/ma+bjHJMs6SEcc0swIg5RXhXn6ocNzsnKP6X5k7OqiY9ytQNIledGZ5qI/3DDg3Eya hf+Xzh1HRv60I9klaLTPsCabJWdGdirCyHy997xUm7782SQMKF6BJK5g3imqziypNBmR S90LTX7p1rZYhA8hdST3EjKLgXK1SPIkoM1cO8K8cvQWNptktX0u3AoeJDDEHl3Jbues 8CLS2wRE8EYnmeEDMJVE3bJtD7ybSRtLKWGCdvtShMHlbobVY+b+lyS4KDdm95MXUfV7 qpGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=z1dd7qB2dn2ZlP15fr9/XnHG7J/ipuohJDgOwA4dvfE=; b=JfaUPSTaXvhYLY0YODVyABCdYF/y0Cszky7Pduk3JIsF0/iE8bSc5UFl1ICVvsXgRY YDGJZ2fMZiFP3+ErZ1fwpbsND0YjOIATJ0NbT0FkW2H9wDzFWwn1GM/pNGdbH+8rnsgD QiML3cfUTGL/XSpSgoisz7gTUpaLQ9qMGeFTXNDXDRzEYMdljxPrcLpTTbp4Yp0GjYYX KVtHYFB0so5ncMDZNLW8isRDcSxDr3uSuyYkIhBRBymiwTw0fNJuGv793mw08BV1CFav k4zhDQToJQxxcHA63n3JU67r6a51cYQiqNJkTL1WUMjLP6l0Xp7+wCSoT6TGFrx4Lgix L4fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=cBgsPFy0; 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 u10si13950617jat.85.2021.08.21.16.14.25; Sat, 21 Aug 2021 16:14:36 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=cBgsPFy0; 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 S231288AbhHUXO1 (ORCPT + 99 others); Sat, 21 Aug 2021 19:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbhHUXO0 (ORCPT ); Sat, 21 Aug 2021 19:14:26 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54FFEC061756 for ; Sat, 21 Aug 2021 16:13:46 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id b4so3782745ilr.11 for ; Sat, 21 Aug 2021 16:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=z1dd7qB2dn2ZlP15fr9/XnHG7J/ipuohJDgOwA4dvfE=; b=cBgsPFy08HLg97aYXrYkozG0I5vo9drn2oiSnFRmKFkcRmQ5RN0h4XEhFpIp/e8OA+ iuPhHEModNiSa4fy8S/RdkqiS9X0RwuuFuy8+f0vWVO7q+0qZjHDZ/qER3QsDDITCQJB yr/leLbkuO7jrJjKrOQxSwnh5lXAgWCj4Y7e1IzEk+xQHuj/ULdhA+S7s1LXB+EIX4/3 QK99uvI6K5Ysl8mdDz/tc3EdRkSYydAiThxz2BvUbIfgt1wUfnahm1wUD0Z7XuZkDQ+f 1B+y5hCC/J0nAmbncW349iPPWTxqh/xbwWCp2YprZW9pTTh+bu79n0nLLoJFCg8VT4gF lHuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=z1dd7qB2dn2ZlP15fr9/XnHG7J/ipuohJDgOwA4dvfE=; b=IYYV6JJ4o5pzmz011wkzzqeAY/Op3za8HdrBCpL9TGskFMtyf4AE13zDe0oIjgM2B+ EnRZ0I4jWOZgXFm3NOG6eU7h+39bNkAeYgxaaB/mzb444P+zy+2s0VMd7/y4dWBsunNL hXiUxjGlp2clBBfzoKF3SpF7EbgzXxvy8VvRcdBlR+7fotOHlYkWTwCPAmv6ViqKZ8tn M9sDFnx+ohFjG1QRk3q/Zn4YQkHXMonUKPIzRiCRv0JTVkgF7A0r5naqr2NGrT2A/NE+ WH/BKKVOY3e/Img4CL/Dwmixc/7gE7DG25raXg5uCB+VDQtCN44ol/575qSXtE3ODJhn zM7w== X-Gm-Message-State: AOAM532aXI4MuFu5kiNgi2LHtFmXMpJegWPBjY/WNEOlQLrVNgAgY8HO Jz+oJTlYNUiOy5TJLMYjJjxqMA== X-Received: by 2002:a05:6e02:13e1:: with SMTP id w1mr19413927ilj.116.1629587625695; Sat, 21 Aug 2021 16:13:45 -0700 (PDT) Received: from [192.168.1.116] ([66.219.217.159]) by smtp.gmail.com with ESMTPSA id c4sm882045ioo.2.2021.08.21.16.13.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Aug 2021 16:13:45 -0700 (PDT) Subject: Re: [PATCH v2 0/2] iter revert problems To: Al Viro , Pavel Begunkov Cc: io-uring@vger.kernel.org, linux-fsdevel , Palash Oswal , Sudip Mukherjee , linux-kernel@vger.kernel.org, syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com References: <3eaf5365-586d-700b-0277-e0889bfeb05d@gmail.com> From: Jens Axboe Message-ID: <120e5aac-e056-1158-505b-fda41f1c99a5@kernel.dk> Date: Sat, 21 Aug 2021 17:13:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/21/21 4:25 PM, Al Viro wrote: > On Sat, Aug 21, 2021 at 03:24:28PM +0100, Pavel Begunkov wrote: >> On 8/12/21 9:40 PM, Pavel Begunkov wrote: >>> For the bug description see 2/2. As mentioned there the current problems >>> is because of generic_write_checks(), but there was also a similar case >>> fixed in 5.12, which should have been triggerable by normal >>> write(2)/read(2) and others. >>> >>> It may be better to enforce reexpands as a long term solution, but for >>> now this patchset is quickier and easier to backport. >> >> We need to do something with this, hopefully soon. > > I still don't like that approach ;-/ If anything, I would rather do > something like this, and to hell with one extra word on stack in > several functions; at least that way the semantics is easy to describe. Pavel suggested this very approach initially as well when we discussed it, and if you're fine with the extra size_t, it is by far the best way to get this done and not have a wonky/fragile API. -- Jens Axboe