Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3741640rwd; Mon, 22 May 2023 20:01:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4peygS2xr10kc4Pjy/LhPDaZMOuJSW9O7w5lGz4MVTV7WtJEgePSeVITcpEXPV2b5/nQ/Y X-Received: by 2002:a05:6a00:15c7:b0:62d:d045:392 with SMTP id o7-20020a056a0015c700b0062dd0450392mr18261178pfu.32.1684810893203; Mon, 22 May 2023 20:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684810893; cv=none; d=google.com; s=arc-20160816; b=XDLO5aGgWdOy++RJkDQBJdFpo88gtgR1iBHNDPfLeDyvpLQMB0hpodQYseIKr7rVMH E07qm1Hs/Hd++DhtL1LRR2bX4Q7SSfoSJE1sUkRZoVjqCFAr90+6lEu2KxZuyQLKYu+u kecP0jsw5RSutFTj1m1R5EZGIaluOUE7+IxhSZDUBPpSBokRpmpRSTJuMDh0mWfImH4b qS1io46/R52viWDm+44L7tmtacj3qBVosAKJAWmxYaX9KOeE9vq2W3JejqiQmCK57UtT 0BJa9uGkgui7ZhHL5e/yzOi06eI1Y7yE9AFzPcyCJBZu4d5f5wswLepNSL4hz56bB5M3 8imw== 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; bh=QyDC4eQlgGYqMmIU8cPLn3Kt/uDu+5TzrouPAJa1xls=; b=bPflnj15MycxriixgxydnwBdrSeOEA07jy9LPAsHI2U8cq87xId+uda3fCqS0UWUAW GA61BOKfpwb80XAjKy824GjE5Rn4irnEtM/GBl5whsokWGpX/KwgU8MFaU+4+buLFUID 6dVxcy4pGpaZmjXKNnTDU2VZ/IeqOu4xWm++5LKiSXXsJTIaESjzoAE0dcH8XObY6pSO HlqiFM8y+dmxL2Cd8Ae/y9qucYoIMYXKlanTDgC/QWTFdcerABLUhXGdCBUJP/zhT8jO iWtEfV3f45IGKHuS+c/15tdodf0dfcD+8F9oyM1TBSKCsmsxiMlcZb0RfIYx1lINvAt/ u2tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020aa78f27000000b0064d430f104csi5000443pfr.206.2023.05.22.20.01.21; Mon, 22 May 2023 20:01:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234864AbjEWCnS (ORCPT + 99 others); Mon, 22 May 2023 22:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234849AbjEWCnQ (ORCPT ); Mon, 22 May 2023 22:43:16 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27BE9CA for ; Mon, 22 May 2023 19:43:14 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VjI7rPy_1684809791; Received: from 30.221.129.40(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0VjI7rPy_1684809791) by smtp.aliyun-inc.com; Tue, 23 May 2023 10:43:12 +0800 Message-ID: <002ed0eb-1195-ce7e-06a0-d85155f67f04@linux.alibaba.com> Date: Tue, 23 May 2023 10:43:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] ocfs2: fix use-after-free when unmounting read-only filesystem Content-Language: en-US To: =?UTF-8?Q?Lu=c3=ads_Henriques?= , Heming Zhao Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Mark Fasheh , Joel Becker References: <20230522102506.9205-1-lhenriques@suse.de> <87h6s47dxw.fsf@brahms.olymp> <20230522123623.eozzedrogy4oaj3w@p15> <87cz2s7b6m.fsf@brahms.olymp> From: Joseph Qi In-Reply-To: <87cz2s7b6m.fsf@brahms.olymp> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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/22/23 9:22 PM, Luís Henriques wrote: > Heming Zhao writes: > >> On Mon, May 22, 2023 at 01:23:07PM +0100, Luís Henriques wrote: >>> Joseph Qi writes: >>> >>>> On 5/22/23 6:25 PM, Luís Henriques wrote: >>>>> It's trivial to trigger a use-after-free bug in the ocfs2 quotas code using >>>>> fstest generic/452. After mounting a filesystem as read-only, quotas are >>>> >>>> generic/452 is for testing ext4 mounted with dax and ro. >>>> But ocfs2 doesn't support dax yet. >>> >>> Right, but I think it's still useful to run the 'generic' test-suite in a >>> filesystem. We can always find issues in the test itself or, in this >>> case, a bug in the filesystem. >> >> It looks you did some special steps for 452. In my env, without changing >> anything, I could pass this case successfully. > > No, I haven't changed anything to the test. I just make sure there's a > scratch device to be used. > > Maybe you can try to enable KASAN to catch the UAF. I've found the bug > without KASAN (i.e. I saw a NULL pointer panic), but enabling it also > detects the issue -- see below. > > Cheers, We'd better append panic dmesg to patch description as well. Thanks, Joseph