Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4707538iob; Sun, 8 May 2022 22:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmEEH/dVL/5W6F+qyzdwRyWOumNxPe26mfOUgaRFP20WwIFO9+LvOLHIFi2+36QXMDqwYS X-Received: by 2002:a17:90b:384d:b0:1dc:a631:e356 with SMTP id nl13-20020a17090b384d00b001dca631e356mr24169435pjb.82.1652075149315; Sun, 08 May 2022 22:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652075149; cv=none; d=google.com; s=arc-20160816; b=oX+qLv6ghaYm8071fZJDII5wdfBYV9DH21oUr1melOYucMeQRgBTLXauwBOAvN5CNt HjFJG26AMn69qLgEBo+RG55SzVbAbhMKBxfGscv9plvAFJiVoRCPp1HvW8+E3iwyjZxM oi5SWqL+xk2ORPaXHOCX6fXQCzmcVIuqkkMG2XcpswGgQCSMT0lT7foNPzER8IfeQWbE n7E39xYlPViqV37kJn7C7NvMIFT0CviOqVl7JmV16Iuqq1R5uNXdR5Km2VLZeoklMCnC kZEa38gKznniv0Xas+hLykAfeyhkXRov7hCjkzG7v7p1oMdHX7WALqCWPkqI2A5Wfpnr JW+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ho9WJbdLiWPZ/4qNJpTqUhf2IK1l980DdbUsNdLi8wc=; b=ozLbjEOFZuuO6IoSVueVR2rDX+M1oifg/Y4hXRmhP56Wzd72QDU2xln3NV/cnPxBcd +DOgfVf2EeYMxyodhrbUFr83XvAgC6FCnqx9WnhZJu8MHlM4Ewm7aNjm39fG2skm8Uqv JMD3HdJXLvsYOp3/FRTEt5/JjAavs+uhE4ixChBvT2KxtY511CcRir0nNPQCUodGWw40 8IF3olmy2huWRIWwcEtLjB+j3tYAjV1ZJH4qhW4W56XpyVXVl5EBqiaga03hWsV/S16E 67IWfpKDgSX3ZovWPsr7MlUEmgiIePThkVBpxuauIReWubslCL6WYliOrdgm2KaOT6Nu 1Uyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=aRlj0uGh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b1-20020a170902bd4100b001586190b7c1si9095750plx.528.2022.05.08.22.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=aRlj0uGh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2201B15D337; Sun, 8 May 2022 22:44:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446531AbiEGOWh (ORCPT + 99 others); Sat, 7 May 2022 10:22:37 -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-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 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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