Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp760274pxp; Fri, 11 Mar 2022 14:24:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtB8MUjs0cOkzB5rLgR+ZIG+2CZOqwP30+pMCjmeHEcCFn31G1xVQwkP19C3qHGFuA8thK X-Received: by 2002:a65:6e09:0:b0:380:4723:b4e9 with SMTP id bd9-20020a656e09000000b003804723b4e9mr10526625pgb.346.1647037441028; Fri, 11 Mar 2022 14:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647037441; cv=none; d=google.com; s=arc-20160816; b=ll/B+OH1mwAINUBrXYioz+/H1ZhmcVccDyS7zKKo1JyILS1jBurYlospNXbD/XjQp4 lc6tMBVs7BGDI0lTchv+Dvt1uNB3nbu4Ir/1B5NPQnPDWHUeoRPR1XYk+A5Jvzwgdefv TAeKbElIkDJfGUR6jZseyaKykKfH9OsSKcjy4EpxXzPd+g9HdVMOpVTTNhAHhGXfzErt txaVbrcbbXe8tLwzGIDHjQMwo/pR3FqCl1BwLeiIcvm44cJ2tGSYSw/IVHp4C01z6hm4 0pwTkyWq3jeesdS1s2aV2IuSbbAnoni6gQbc00r7/0r/PgBtuvsnNMpNk8iB+ua30RIt kG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:message-id:subject:from:cc:to; bh=APSYLW3XdvsN0W4rbIEXstFyphisX8pyPdVkw4IAVSY=; b=zbM49GrtKZ8RPL5zhk8PlEE16m04vDs3KFYY2d7XmgPfMesU618i6KIGbR9+W30dja paugYb1QnSlcLr748wadzhRCFNNeKC/oyhucIMN9PW7MqQdjliOheSszc/6+m+fQyi2w 5PQsOO7mLS/Bas7t2osbTKV0wIYbXbETC0F7rmnCGjDQEX2wgBZIkEmaTqCEIzKqsDtN IszOSIzK0WPXq6XWUTf5BeEtd51khKS53MHy7XpkhXqV132OAlfsxBd1vRRjxHSewQAo dhNYQGoK0VWcEggPmfboQJMCjUj4q6UGhr/8DjTmVavO1IFVoZNXHsM3qEEP4J/lAgj1 rr4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q12-20020a170902f78c00b0014c91395314si8941627pln.60.2022.03.11.14.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:24:01 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2615D22FD87; Fri, 11 Mar 2022 13:31:55 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236802AbiCJPSc (ORCPT + 99 others); Thu, 10 Mar 2022 10:18:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244259AbiCJPSB (ORCPT ); Thu, 10 Mar 2022 10:18:01 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7374DFEB; Thu, 10 Mar 2022 07:16:59 -0800 (PST) Received: from kwepemi100014.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KDt0N47l5zBrlV; Thu, 10 Mar 2022 23:15:00 +0800 (CST) Received: from kwepemm600001.china.huawei.com (7.193.23.3) by kwepemi100014.china.huawei.com (7.221.188.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Mar 2022 23:16:56 +0800 Received: from [10.174.176.245] (10.174.176.245) by kwepemm600001.china.huawei.com (7.193.23.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Mar 2022 23:16:56 +0800 To: "viro@zeniv.linux.org.uk" , "maz@kernel.org" , , , , , CC: linux-kernel , From: "wanghai (M)" Subject: epoll: Does anyone know about CVE-2021-39634 Message-ID: <37574411-707e-89c9-5e77-35b254337664@huawei.com> Date: Thu, 10 Mar 2022 23:16:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.245] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600001.china.huawei.com (7.193.23.3) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 I've spent a long time and can't figure out the details of the following CVE, can anyone help me? CVE-2021-39634 [1] In fs/eventpoll.c, there is a possible use after free. I have two questions: 1. How does the UAF problem happen? 2. Why it can be fixed by commit f8d4f44df056 ("epoll: do not insert into poll queues until all sanity checks are done") [2] I'm guessing that patch [3] solved a problem similar to [4], is this correct? Any feedback would be appreciated, thanks. [1] https://nvd.nist.gov/vuln/detail/CVE-2021-39634 [2] https://www.linuxkernelcves.com/cves/CVE-2021-39634 [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f8d4f44df056c5b504b0d49683fb7279218fd207 [4] https://cloudfuzz.github.io/android-kernel-exploitation/chapters/root-cause-analysis.html -- Wang Hai