Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp849332pxb; Fri, 3 Sep 2021 15:19:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzS9m4rbc18K5lTTfLveHCEvyoya5eqPH3u8ppDjmTufv7RDr/2VI/hkDi+A7ktSewfqjd X-Received: by 2002:a05:6402:4d:: with SMTP id f13mr1142325edu.275.1630707563336; Fri, 03 Sep 2021 15:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630707563; cv=none; d=google.com; s=arc-20160816; b=WW/PkfDpcwkATQbPuO632ZbYPg4UNbrlqoZBlLB++GG/3uW31Pa87q1X0zGwkgEywj PRv+t1vSaCKY1LaLza5fhU+ezsQUJgZK2FzAfCuBuXiHRlTaCprwjgZkdFaLoKmPlO6D zrOsHLYmMKiF3PwRKgYt2WkBiLzIHQ5oShq+GBd8Fe+5Oy5fsE/+2ssNtiWRHUeZlkpV GqCpFV86vJ/+WH5QDIsz92XQpF4g5hO0ziHosa1PBUmy2aFM3phBh5C+bhEVPdxFzNwC dy3ftUVmIlz/7gROGaQUcQhJmDGsyeO/kGvD5MXV3x51DmL8dkGnpA2XPY8WwA5knRqh cHhQ== 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=eT/fQDFHhtoroQ1QTnldwHuwqPcLrJVJfw9Ca1Z26XA=; b=CwZKSoGl8PvqAVVzrehRG/WLkNgxMXvz9SSyhQ3BbytmE0JkBYsEyBKbajeRXyjN9h bfGZOtyhEofiVPVyB21Rop5gmeciPv+qggbZa8y7Fi0LHUuQf3vY5bdD8XOUg0i+vt2T zAYP7/AtZghC11KTva5SQq5PdkmYFwvxqQ2ylQeRwcWz8jHnIdVahA/WtwAcv8cF5RYU youMxIVwVj84utYXXWoJUUnBuV6J5tJuFHKbw8YgTw+QyL1S9QLr3S+bsEdfLC7I9kwW TijM7GSb9pLOFH24mmBdDKYCSwwulwKvjuOZ6a1xb905JDJqFgBEin+NoVPzbe6HNKd+ O9xg== 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 r14si666033eds.406.2021.09.03.15.18.57; Fri, 03 Sep 2021 15:19:23 -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 S1349762AbhICV62 (ORCPT + 99 others); Fri, 3 Sep 2021 17:58:28 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:52336 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344767AbhICV61 (ORCPT ); Fri, 3 Sep 2021 17:58:27 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMH9W-000tKw-R0; Fri, 03 Sep 2021 21:55:14 +0000 Date: Fri, 3 Sep 2021 21:55:14 +0000 From: Al Viro To: Jens Axboe Cc: Pavel Begunkov , io-uring@vger.kernel.org, linux-fsdevel , Palash Oswal , Sudip Mukherjee , linux-kernel@vger.kernel.org, syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com Subject: Re: [PATCH v3 0/2] iter revert problems Message-ID: References: <65d27d2d-30f1-ccca-1755-fcf2add63c44@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65d27d2d-30f1-ccca-1755-fcf2add63c44@kernel.dk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...