Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp942010pxb; Fri, 3 Sep 2021 18:09:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl5QNqgd12Rg26LRLfiei5byT3Ce5pjOxaPdfFhZkDJKZnviawIV8+S6aD09HVXE35gg6E X-Received: by 2002:a5d:9145:: with SMTP id y5mr1286369ioq.200.1630717772106; Fri, 03 Sep 2021 18:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630717772; cv=none; d=google.com; s=arc-20160816; b=ahxrabvOHWz08LMja8q8mAyweH6/cxny2/a2BP5wldt7e9qg+aOcQsg2ZiI9l92Fvd vWYwiOGrHHdal4W443/WetdQQe748i2pb5csN3w6kQwzhbpjKM3+uFj0Q6MesEHLwKyq vv7Z1OZjAc8r1R2o/Dh+J1JAFw1Z1816rf8mLHYu9+aA7jAa1zuFHZZJ8k60o41ZM/wV V+79qqHiS4gbvpCbwRzR5kBpzY5aCNIu7gZGOQ8tB/tptQx1SldBNR/Hb0U0EQoDT/6T YKU2oD8UMMfgl0hOBPyCd2uKxX4VnAkI7EmSm9B3EnpPMNZgFONQQmw8x4eKD4yTQXrQ WuEg== 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=xz8nnMXJDbBJ194DuFd2giPN2/XCiMv/EpcFRaBE6MY=; b=jAQOFbZcyQPyIgD0fZxdklHRDB4hu40Pvl67hG1FXawhFXKJAm8vu/YbTLAqBkhKW4 kypq8uf6ACQ/mQJkU4SIHjDWdkBS25aYGFS6dkLiywUtuJMQMkqGEMJG1bCBQQhHXGQH MUMYYTcQq0LJHo+bWlWtSfHpy3UITFzkRXY6YDeAxjlPW83KAq1WXfYBUUfoYopMuyAP MWHLpY3gON76IUql6eAFzctOyVM6F42k2jkuFcgMjvRb+DeUYJqcq1CdPHz1xgclVOiS qopTjN7GCKP+/IH/pOrgPGeJyIqQ2Co0uyG/va9MTr3VzCmSLEarRARfiCFZr8hQrjSM fpqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=E1TWI6Ez; 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 g3si774823ile.29.2021.09.03.18.09.07; Fri, 03 Sep 2021 18:09:32 -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=E1TWI6Ez; 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 S1350794AbhIDA6g (ORCPT + 99 others); Fri, 3 Sep 2021 20:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236127AbhIDA6f (ORCPT ); Fri, 3 Sep 2021 20:58:35 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3653FC061575 for ; Fri, 3 Sep 2021 17:57:35 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id i24so780912pfo.12 for ; Fri, 03 Sep 2021 17:57:35 -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=xz8nnMXJDbBJ194DuFd2giPN2/XCiMv/EpcFRaBE6MY=; b=E1TWI6Ez3mIdBOoL2FupyZ48lierRN65SgA5BnsjL+J1/Fk0hqr7Cooy/423gpEEx4 wJ9hhxRfBm5TTDdegOPMDKBlcmU2UA7U85KarR38qj8SXMGSZGfAk/RrOwwwd6nW/mkd M/k2tDotI/DtUQS+byWW1drSD5ELfWG1CuXoQONM0hEtVsZ0MbWXgCT/0Q3ehGBK/NDy XHSzqjUz4PyjSnwpiP7JCC5H3PtYRZjouVN16PB2uRHF0LwIxp0O++1jvZA97uouBYFF iv/LCi8oOo/4OyAAyGCCy3gWsSB5ydaRJq63kd1KDp6A+WkxoF2GSTnsJ5wmU+iqJiv0 i3yA== 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=xz8nnMXJDbBJ194DuFd2giPN2/XCiMv/EpcFRaBE6MY=; b=mHdcWuF4roVFtfA5m6bloO+Oc0Vt6Yu2XzBorxBxaiGlm2UGOv4MbySRXld+a2MC6R WpyfZDj/MOh3DKq+/LYziIXFf86luiRE1DI5xPtaKaV9Vn/cq2LkAzspNLNpRnnZpWKR swTcavAMRGRiwt75yj4UicO77HpIX/fAFWRXTOKMU3qoOxjAU3M9zRHuAIJyd9z6XPcP mlsUNkYEbBnc+RSNdkOOXQzR0+xGmUChdXouY/1vlSD62g7hkH1eqQdCmEGqPXsTFJB0 THEw/T+N6RbijovMXLaTC38TLdyLP19KebhEz2llowkfgVWzzZH59a/o+HntWr5uyFmu 63pQ== X-Gm-Message-State: AOAM531uKeatPpypuseQ1HsRE1Q9XOBYNdFHDgdmPzRFWwMOsQsuW2zu yfo82rHGA4pCaulQO8hP/v8a2g== X-Received: by 2002:a05:6a00:1c65:b0:412:f893:fc6d with SMTP id s37-20020a056a001c6500b00412f893fc6dmr1288038pfw.8.1630717054524; Fri, 03 Sep 2021 17:57:34 -0700 (PDT) Received: from [192.168.4.41] (cpe-72-132-29-68.dc.res.rr.com. [72.132.29.68]) by smtp.gmail.com with ESMTPSA id p10sm527113pge.38.2021.09.03.17.57.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Sep 2021 17:57:33 -0700 (PDT) Subject: Re: [PATCH v3 0/2] iter revert problems To: Al Viro Cc: Pavel Begunkov , io-uring@vger.kernel.org, linux-fsdevel , Palash Oswal , Sudip Mukherjee , linux-kernel@vger.kernel.org, syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com References: <65d27d2d-30f1-ccca-1755-fcf2add63c44@kernel.dk> From: Jens Axboe Message-ID: <72e3c837-8e44-8bc3-36c2-4a8682892a62@kernel.dk> Date: Fri, 3 Sep 2021 18:57:30 -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 9/3/21 3:55 PM, Al Viro wrote: > On Fri, Sep 03, 2021 at 02:55:26PM -0600, Jens Axboe wrote: >> On 8/23/21 4:18 AM, Pavel Begunkov wrote: >>> iov_iter_revert() doesn't go well with iov_iter_truncate() in all >>> cases, see 2/2 for the bug description. 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. >>> >>> v2: don't fail if it was justly fully reverted >>> v3: use truncated size + reexapand based approach >> >> Al, let's get this upstream. How do you want to handle it? I can take >> it through the io_uring tree, or it can go through your tree. I really >> don't care which route it takes, but we should get this upstream as >> it solves a real problem. > > Grabbed, will test and send a pull request... Thanks Al! We should mark these for stable as well. -- Jens Axboe