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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23FA6C07E9D for ; Sat, 24 Sep 2022 03:34:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CEB48003A; Fri, 23 Sep 2022 23:34:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57DE880016; Fri, 23 Sep 2022 23:34:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46B688003A; Fri, 23 Sep 2022 23:34:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 347F580016 for ; Fri, 23 Sep 2022 23:34:46 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 042AB1A03FC for ; Sat, 24 Sep 2022 03:34:45 +0000 (UTC) X-FDA: 79945562172.25.91DAF53 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf14.hostedemail.com (Postfix) with ESMTP id 190C5100004 for ; Sat, 24 Sep 2022 03:34:44 +0000 (UTC) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MZDzS3NmFzHtd7; Sat, 24 Sep 2022 11:29:56 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 11:34:40 +0800 Received: from [10.174.179.24] (10.174.179.24) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 11:34:39 +0800 Subject: Re: [PATCH v3] mm: hugetlb: fix UAF in hugetlb_handle_userfault To: Andrew Morton References: <20220923042113.137273-1-liushixin2@huawei.com> <20220923170554.7046bb023f8cf582b5909b77@linux-foundation.org> CC: Liu Zixian , Mike Kravetz , Muchun Song , "Sidhartha Kumar" , John Hubbard , "David Hildenbrand" , Kefeng Wang , , From: Liu Shixin Message-ID: <11391501-c901-fd4d-5a05-50952aec011c@huawei.com> Date: Sat, 24 Sep 2022 11:34:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20220923170554.7046bb023f8cf582b5909b77@linux-foundation.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663990485; a=rsa-sha256; cv=none; b=PYM2CE3iRAbyoW4CTCy3Fr9ct0M9b150KJdLUgBgLpq+8msiG1IxJ6yd1voRPIzxKwh5wF 9F0lUdH6A2/geUPZOJZO7LCmnc80+lbrznoQnXHt8EnhzGDG6Y3vxOpGEKhXU1CJxKSyGh cZ/KAFa+yX9kxhXJwF25VIlYEGXH6IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663990485; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qnXzzx1W+KmdZu1XlJ4xZemvPzghvGebcFlNdAGpYbI=; b=BQMD5850r51TPPBfAd2IFD5IOJy/K5ZsX0w6ZRxRDgE5cIQWEZnk0gxrxs2EHyo3QWsOhE OTinPi5uUUQf3GU9jroJmaZCl59O7QjIHF25OgwhcxpnjZINLHqzvurKwTDC9rMK+RBZcZ aZq/gYO1iRWHW8dVs0rd8sFguVLBUMM= X-Stat-Signature: xa84ooc5z1hrzu6pr18ys46e378u1sge X-Rspamd-Queue-Id: 190C5100004 Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1663990484-529065 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2022/9/24 8:05, Andrew Morton wrote: > On Fri, 23 Sep 2022 12:21:13 +0800 Liu Shixin wrote: > >> The vma_lock and hugetlb_fault_mutex are dropped before handling >> userfault and reacquire them again after handle_userfault(), but >> reacquire the vma_lock could lead to UAF[1,2] due to the following >> race, ... > Patch is against mm-unstable, which isn't appropriate for a backport. > Could you please something against current -linus (which will be more > backportable), then I'll figure out the fallout on mm-unstable. > > Thanks. > . I resend v4 rebased on current -linus. Link: https://lore.kernel.org/all/20220924034905.2694686-1-liushixin2@huawei.com/ Thanks,