Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5129766rwn; Mon, 12 Sep 2022 05:02:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QSKIgm5FM5sjEwF5QAsXQ/jLPC6yy7rGQLB3bRijCAwu0CuzSXhOAZHQ4ahLHhUH0bcSI X-Received: by 2002:a17:90a:e586:b0:1fa:d28b:ab9b with SMTP id g6-20020a17090ae58600b001fad28bab9bmr24059221pjz.47.1662984144585; Mon, 12 Sep 2022 05:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662984144; cv=none; d=google.com; s=arc-20160816; b=k65qosa90s4ki0w6cVOaMz9wJMNrKlY40iHgvlfKj0Q2Eda9UeUaSGKc3AjRf2QVtw 6hxcl/rIdPCNCwmRo/O4cEcKpAHL7Vmh1s299/aRH4IVIvZiwZILmU/J53/t4htf3Wmm QQ7Ia4MnzCMSKsej2cnWKG6DfQv6tONak++z3ODfxl2fpyFY5dKgDINHkKcurCgY77x6 OQI2kntqh2Rz5OpypZMZN0CmKXQm7KrtZkyxDePVEJiC5FeS+nsPyY3tz4eQK0/dnYgV +KEo1m37Vwe4jUETKwuDVFcjpY7vOHQJibikOVV8ILwt8vE/dmxaxujy0+GhKHO5E5hA mPJg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=31BOOnO/GW1+Xq5GxheeNxQGeYpx2dHT2PclO+FF8UI=; b=UX/8/UBkBqmeu4VgBWWcPvn0kDWc/3jnIXKz1pVKxbI4XmQLtjf6kHWvwzC7UIr1Hd RZEjuva/1P3oxJNUcyDfbpGMma9jfi0ZRM2xX3tSIkzY+AdCpUd85RsVABOj1VzT+xhM zPPhkwv4fQvg1lH3Sy1y+iKuPvX9Q6Ul6NBRsQq06PoK9m7Ojo3rpTTuIyHU+G+9NvcW OgpC42wSnCd7LkcLVz/liCgzyJMDkveYmwqUxmXrYZgOieeTV7M3/bAgr5DZiYnRnFPI 6XlKjW7OuiyeyfrA1j/SU8lQAFOd5hJjv2tjdNKBeN5abfTlA//xLudy72SIFDwcI3sN l+5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b="FxkzeA/m"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc7-20020a17090b1c0700b001fdfc3ea521si9675159pjb.143.2022.09.12.05.01.55; Mon, 12 Sep 2022 05:02:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; dkim=fail header.i=@mit.edu header.s=outgoing header.b="FxkzeA/m"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbiILLzi (ORCPT + 99 others); Mon, 12 Sep 2022 07:55:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbiILLzh (ORCPT ); Mon, 12 Sep 2022 07:55:37 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E981921815 for ; Mon, 12 Sep 2022 04:55:35 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 28CBtHaf031208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Sep 2022 07:55:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1662983719; bh=31BOOnO/GW1+Xq5GxheeNxQGeYpx2dHT2PclO+FF8UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FxkzeA/mNEJ4nuIp6u2oWm5vf2zblZjpaDmeoPF6QoKKzCUKwkSMIDOMHxMW+S6a4 2RRCwk6tGS6H/A7PyHY2qVklndfAdGlZFci/nEGhPFcMe03XCSrYIWH8cOsuTieHQ7 Zwe+GIxX/zU6oR7p/rWK3ABwpy0nk/i+qVWdnkmRkQ+RLDA22NmiPFJQL/TyN0rpIq fRHxGMEKRPbvYXslgphBB9l7AqJQrqRBtUzXtEr8CKrXijIR+r8SLVv0pc0+8DjNsZ l6psHY7pLKy0u2e94AZx8s1XK6/GE3poTAvMAqn+b8WhhENfShUclnCAdB+NBq2NyD u6kYC1WZshFrA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 99B6515C526C; Mon, 12 Sep 2022 07:55:17 -0400 (EDT) From: "Theodore Ts'o" To: liuzhiqiang26@huawei.com, linux-ext4@vger.kernel.org, adilger@whamcloud.com, zhanchengbin1@huawei.com Cc: "Theodore Ts'o" , wuguanghao3@huawei.com, linfeilong@huawei.com Subject: Re: [PATCH] tune2fs: fix tune2fs segfault when ext2fs_run_ext3_journal() fails Date: Mon, 12 Sep 2022 07:55:14 -0400 Message-Id: <166298370796.2551439.6275034691916615030.b4-ty@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <8e87fbc3-674a-af30-1234-54b36eb5ca5d@huawei.com> References: <8e87fbc3-674a-af30-1234-54b36eb5ca5d@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org On Mon, 5 Sep 2022 19:16:03 +0800, Zhiqiang Liu wrote: > When ext2fs_run_ext3_journal() fails, tune2fs cmd will occur one > segfault problem as follows. > (gdb) bt > #0 0x00007fdadad69917 in ext2fs_mmp_stop (fs=0x0) at mmp.c:405 > #1 0x0000558fa5a9365a in main (argc=, argv=) at tune2fs.c:3440 > > misc/tune2fs.c: > main() > -> ext2fs_open2(&fs) > -> ext2fs_mmp_start > ...... > -> retval = ext2fs_run_ext3_journal(&fs) > -> if (retval) > // if ext2fs_run_ext3_journal fails, close and free fs. > -> ext2fs_close_free(&fs) > -> rc = 1 > -> goto closefs > ...... > closefs: > -> if (rc) > -> ext2fs_mmp_stop(fs) // fs has been set to NULL, boom!! > -> (ext2fs_close_free(&fs) ? 1 : 0); // close and free fs > > [...] Applied, thanks! [1/1] tune2fs: fix tune2fs segfault when ext2fs_run_ext3_journal() fails commit: 66ecb6abe5d2c74191bb4bc24f3da036e5fa1213 Best regards, -- Theodore Ts'o