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 F208CC7EE23 for ; Tue, 23 May 2023 02:43:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234859AbjEWCnS (ORCPT ); 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 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