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=-9.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 D9845C4338F for ; Mon, 16 Aug 2021 15:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B402660F39 for ; Mon, 16 Aug 2021 15:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236035AbhHPPfu (ORCPT ); Mon, 16 Aug 2021 11:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhHPPfr (ORCPT ); Mon, 16 Aug 2021 11:35:47 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63D2AC0613C1 for ; Mon, 16 Aug 2021 08:35:15 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id r16-20020a0568304190b02904f26cead745so21379010otu.10 for ; Mon, 16 Aug 2021 08:35:15 -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=izwgpX7oSIIBHk0sYhZRSPI0m7nv9ZWnNviimlv3Gso=; b=vfpaG8itDkP6v04+k6YoH4XGZJLxHWYS9XMAriNKK//2SkDt3NN7yK1kiF1WfB38UN d4zrAaVVkQsDMG0QZjZtQgB9Xb3GgRM8/7fGsQyUR2g5gVveE7FZh0l/S48Ad1yRNKCW lDwIkecxFeEy0MLogCx5z1bedl3y7Vkwhzgl1OfUvPMLdnO7MZjWDbBTLFka0Tcf9bBt lvRz/oJrh2FEV3vcdUcXjy26++zbEPcOAzwWpZ1jKGn5PmBm2Xa5YzlWExU/4z+wSSap GaFGgbrtBGACITtrbzW22viwPxcaM3ykRc2D8strDPLQwOolMlWh+9krFzaq/yRMsRWs 3cxg== 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=izwgpX7oSIIBHk0sYhZRSPI0m7nv9ZWnNviimlv3Gso=; b=I8Kv8iizdlsgdTp76jlIknUNyGh60W6MUq7bcmYrZ2LxfixkO5zeHt1W8VI4KGnmfo UCJSgpiQwE/qLd+sXFcT9NRLLzVV+MmAP0qViUMjl1HcS7v+cWSlz3c1sB2EHMHIg5Qp zHp3n++hxA0jLQ2brRa8kdRtxs1fCPf8rD6VJ0UKo5nTtQAevE8rdVhUxtCYWsK6WR00 Pn0oHeGw+lbm214lHNNSK2eovKyQeIHsDkkNi5upNnVoXelWicefj1Cu7+a6BVGOL1PC yMI/DFjaJmUoQ2C2mumJPNNzpfSiRhgPU429iSgNpAKGNhUBpkya3T3AVZecl39H8k5q w/fg== X-Gm-Message-State: AOAM532GnvmRvCOPexF65fptVrO59T+88Z3Qi38xaX4VclN6oGh66DIE hpETn4R1z6VDM3TZDvIdJ754/w== X-Google-Smtp-Source: ABdhPJxNBT6VQqF+a/LrmpscGhFK1PmHsr1ZBxcAfX5odX2+MffbpKSANyXAwOgf8nofz4cDBJlACg== X-Received: by 2002:a05:6830:1289:: with SMTP id z9mr3770498otp.28.1629128114671; Mon, 16 Aug 2021 08:35:14 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id k13sm2121887oik.40.2021.08.16.08.35.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Aug 2021 08:35:14 -0700 (PDT) Subject: Re: [PATCH v2 0/2] iter revert problems To: Pavel Begunkov , io-uring@vger.kernel.org, Alexander Viro , linux-fsdevel Cc: Palash Oswal , Sudip Mukherjee , linux-kernel@vger.kernel.org, syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com References: From: Jens Axboe Message-ID: <221d06f1-7e6b-c48f-57e8-45111c979217@kernel.dk> Date: Mon, 16 Aug 2021 09:35:12 -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/12/21 2: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. > > v2: don't fail it has been justly fully reverted Al, what do you think of this approach? It'll fix the issue, but might be cleaner to have iov->truncated actually track the truncated size. That'd make it a more complete solution, at the expense of bloat iov_iter which this version will not. -- Jens Axboe