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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68C81C433EF for ; Sat, 7 May 2022 14:18:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446532AbiEGOWi (ORCPT ); Sat, 7 May 2022 10:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446527AbiEGOWf (ORCPT ); Sat, 7 May 2022 10:22:35 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E0140E47 for ; Sat, 7 May 2022 07:18:49 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id p8so8553908pfh.8 for ; Sat, 07 May 2022 07:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=ho9WJbdLiWPZ/4qNJpTqUhf2IK1l980DdbUsNdLi8wc=; b=aRlj0uGhsQMp6PIBfqPPu4jOHi7KUQcgEBKPY4RufohgVfcOdlNKpirqcKbPwvEXEY NtrC6Uizaj6D7+6UyaKT3sOwQkxAb6w2VPSdnUdD7ZaOlyzpDDpUTAPT/ftIut8OE9E5 7BlUyJW7N710PyksnJvRuEe9lizWS7PZIMa5kA6KOOkdoFwyF5fbS7nIOarzcM5ec+GI lo5hvTnqqGrUOr6n5wNNWTSx1GItm8k52M6Qvwu3FklSXCTSwOZVqb6pgUy4y2lEuonL MoVdq+109G4olyRO7b1ayZ7peWxXCcJ2ol+y2BZbi59bHrOwzRHmtdRB4D/Sm2Xl64Lo yn6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ho9WJbdLiWPZ/4qNJpTqUhf2IK1l980DdbUsNdLi8wc=; b=VB1NbrLGojPFn1yyoxOclfLUqu88QHhS4imyOHHDy3rLzcVghcBr60G25ivrFqHnWU h1KqtkkANty5pBgkPRy0zPuTifhggbxM9oJWPXqjo1lzPdgLVi1vHPoRbezY8JkPSnJ/ +NVQM2dLSAVNcp5/hjirAL0XO+q0nJ2h6eHuIelfUNqTIet3HPrFIBRl2HtVQz8NTW18 vHCqfHmHQTgYsw37MXb4PDwArZnW0JlhLkfyo37tRdKdPXxm3uZk5ekOxEJdZu4BVs4X eTdikYOE/RUcWQ6cO+uYDhHjeUonBkoJoPtwEmycJ9h/Xvhtdl3muFoOo+hXsoKW0qAa u8BQ== X-Gm-Message-State: AOAM530Lp3dUCDEz4QpzAXDuMuBi+x2kTLZv7+W3n8XAgedN9Jw3y9WP dREbYdxLT94058yn5rOKA/mPBw== X-Google-Smtp-Source: ABdhPJwsBzvBBOWA7uE3ZDSxbPrTafA6LOEbau5fhdxJgcx/lWuBTqg/01Qu5aNrK5CEic6gqvglQg== X-Received: by 2002:a63:1b5e:0:b0:3aa:593c:9392 with SMTP id b30-20020a631b5e000000b003aa593c9392mr6606656pgm.470.1651933128528; Sat, 07 May 2022 07:18:48 -0700 (PDT) Received: from [192.168.4.166] (cpe-72-132-29-68.dc.res.rr.com. [72.132.29.68]) by smtp.gmail.com with ESMTPSA id w25-20020aa79559000000b0050dc7628199sm5334168pfq.115.2022.05.07.07.18.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 07:18:48 -0700 (PDT) Message-ID: Date: Sat, 7 May 2022 08:18:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: linux-stable-5.10-y CVE-2022-1508 of io_uring module Content-Language: en-US To: Pavel Begunkov , Guo Xuenan Cc: lee.jones@linaro.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, yi.zhang@huawei.com, houtao1@huawei.com References: <20220505141159.3182874-1-guoxuenan@huawei.com> <7d54523e-372b-759b-1ebb-e0dbc181f18d@kernel.dk> <31ae3426-b835-3a3f-f6d1-aecad24066e8@gmail.com> <6c417ba7-d677-5076-5ce3-d3e174eb8899@kernel.dk> <4fc454ca-8b3a-28f6-2246-3ffb998f9f11@kernel.dk> <9c4cff81-ff0f-4819-c41d-54f28dba2929@gmail.com> From: Jens Axboe In-Reply-To: <9c4cff81-ff0f-4819-c41d-54f28dba2929@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/22 3:16 AM, Pavel Begunkov wrote: > On 5/6/22 19:22, Jens Axboe wrote: >> On 5/6/22 10:15 AM, Jens Axboe wrote: >>> On 5/6/22 9:57 AM, Pavel Begunkov wrote: >>>> On 5/6/22 03:16, Jens Axboe wrote: >>>>> On 5/5/22 8:11 AM, Guo Xuenan wrote: >>>>>> Hi, Pavel & Jens >>>>>> >>>>>> CVE-2022-1508[1] contains an patch[2] of io_uring. As Jones reported, >>>>>> it is not enough only apply [2] to stable-5.10. >>>>>> Io_uring is very valuable and active module of linux kernel. >>>>>> I've tried to apply these two patches[3] [4] to my local 5.10 code, I >>>>>> found my understanding of io_uring is not enough to resolve all conflicts. >>>>>> >>>>>> Since 5.10 is an important stable branch of linux, we would appreciate >>>>>> your help in solving this problem. >>>>> >>>>> Yes, this really needs to get buttoned up for 5.10. I seem to recall >>>>> there was a reproducer for this that was somewhat saner than the >>>>> syzbot one (which doesn't do anything for me). Pavel, do you have one? >>>> >>>> No, it was the only repro and was triggering the problem >>>> just fine back then >>> >>> I modified it a bit and I can now trigger it. >> >> Pavel, why don't we just keep it really simple and just always save the >> iter state in read/write, and use the restore instead of the revert? > > The problem here is where we're doing revert. If it's done deep in > the stack and then while unwinding someone decides to revert it again, > e.g. blkdev_read_iter(), we're screwed. > > The last attempt was backporting 20+ patches that would move revert > into io_read/io_write, i.e. REQ_F_REISSUE, back that failed some of > your tests back then. (was it read retry tests iirc?) Do you still have that series? Yes, if I recall correctly, the series had an issue with the resubmit. Which might just be minor, I don't believe we really took a closer look at that. Let's resurrect that series and see if we can pull it to completion, would be nice to finally close the chapter on this issue for 5.10... -- Jens Axboe