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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 84E04C433F5 for ; Fri, 3 Sep 2021 21:57:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67325610A2 for ; Fri, 3 Sep 2021 21:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348976AbhICV62 (ORCPT ); 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: io-uring@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...