Message ID | 20230103014517.495275-3-jun.nie@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4391230wrt; Mon, 2 Jan 2023 17:47:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXsApfZbtm/+hSWamTj+yELZnEZjo9hLMe65FyGoTLKFoAg+FM6sakSEMEaT01qgSzOek0+9 X-Received: by 2002:a17:907:214d:b0:837:4378:dbd6 with SMTP id rk13-20020a170907214d00b008374378dbd6mr38245122ejb.22.1672710438047; Mon, 02 Jan 2023 17:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672710438; cv=none; d=google.com; s=arc-20160816; b=UtFxoPrKBViLkyWXVgRqB817Uehjli4Ehlng+dABjb5YBIIgU+HjFLkNCl1Ypq5zqh Vi/E6Z6fZTOlirjrCls78pXi+8eCFXwEQrUKNFX6BIeIDwNaUBvowdwsTP68YTXHbtr8 /jIw8oq094a4WUWzZnEtHqIuWHK+pLrJUqbBNYvibHg+fBv21gMINDQ8R7Hl9OtO5jNc uMhwT3lahkYDeqHW123g7p+AsMUGnPAAgeHMHYKirjNxawGNJSUchuAYp07cl50ck+bX y7NQr0vrjGFEPP2ChZ3Dhm3fmFhtISe8/F/ZNeFV1yfYjg3WpEqQJPB85tj0NMpbF8VI qCfg== 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=pHFNPClZL6YqqHgH05AOCgftoZUseEmSrgezOmi2yxk=; b=QrvC88dZKgPn1AF7u3xOJ2R0za8auiuhx9wrtWJFdsteey0H0TySvdUOcRv6mQ1LE7 Z0GgOLiu0z0F8vlcUimYpvwYdpZkZ17cJ4r2iHA3k8OS2C0OFs3QgTUWX2gC2scbS0iu cQG8r0hQFjiFKMbxv8pzprW87voTtHK+tGoA7AlMKjT/Fzqz6/i2Ysxg8eGQcIjIaJ3W wDB42LYfcyxSOs+mnzfmsJA2SRf5cJV8woqW2eMjAScsFNHqe/ZnNIB9Ebk3vvVh7T6m 8h7nOGCatKdbiibpTG5/YcUhjTu8xZZDRkL1XWIW3kdS7qH1JxQz6DakAfo+1hRQ57PF wFuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O8xlIsgl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww7-20020a170907084700b0084cbf555299si6833461ejb.954.2023.01.02.17.46.55; Mon, 02 Jan 2023 17:47:18 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=O8xlIsgl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236513AbjACBpP (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Mon, 2 Jan 2023 20:45:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236323AbjACBpH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Jan 2023 20:45:07 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 283DD627F for <linux-kernel@vger.kernel.org>; Mon, 2 Jan 2023 17:45:07 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id jl4so24818727plb.8 for <linux-kernel@vger.kernel.org>; Mon, 02 Jan 2023 17:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pHFNPClZL6YqqHgH05AOCgftoZUseEmSrgezOmi2yxk=; b=O8xlIsglgdhduJo7+bHnIGvWYXQKrSsJOgHp4hqykudZgbPYD6sxab2YtDecPhe5ZZ z71fr2qP20MdKzggYU1OjqwHfnIJvKMDEH5uSYiZj3H9xMni/yxQhq2wDNwNsuTMdTni yrFzz7N0iLXSRnRlOiNqjrPASvWyEp9DnJ7DjLi+h4OR0sca6ACpauSN884KUHrSJOC2 Q2TnCuYgoO2EZLnd60QVwr+GyfVJJUTNA8SlA/6+ysEFV4IQpqOeeKlx67MZrTstBpzL qr+djEBY08eU1tO0guKoya9+UA6d+xuTqABpBZ5Kkk95ZS5ZaX9erG8Fcr77jTEZckmN GRpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pHFNPClZL6YqqHgH05AOCgftoZUseEmSrgezOmi2yxk=; b=szdoDxNc9P2kNY8GZO4tyDKY2T8YzpUZf+1Lhi650q+KG34/wUyvJLdmfJ7ofjlsH5 SUiWXZ1GfQYkIyJHBbt+63N51Gdcw+qIFYr/IDQl3uDK1VIFg1rNkxFaXT8sjA3cYvkF ogULCsQQ+Wg/zXUFHKw9J+3VSRWFuhyppW3EekT4dx4W5iwX7xFwy17uujh+vQbJ5NVI uDe3Q/gHZeYakxLuQUWxMYxRNuz38WeeHaR5a3V4HZz1ITSq+IVG4n+JtM2RQVCuUa0M VjZUs2vTD34P7E9e9J/K0LNvPF2kCEWopGlE5HkUPiAlRjD4IRn5sUSdmt+eL/ci7UvT RRdw== X-Gm-Message-State: AFqh2kqALsKeEUw7cXFf+LQfrI4POhRp7ZyieAZHCn2iVXRm1Nq82k0b 7PXu9M9uaLCWEdkZEa2AwHqrjw== X-Received: by 2002:a17:902:cf41:b0:192:82d4:f9b2 with SMTP id e1-20020a170902cf4100b0019282d4f9b2mr28859244plg.7.1672710306715; Mon, 02 Jan 2023 17:45:06 -0800 (PST) Received: from niej-dt-7B47.. (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id f15-20020a170902ab8f00b001769206a766sm20588895plr.307.2023.01.02.17.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 17:45:06 -0800 (PST) From: Jun Nie <jun.nie@linaro.org> To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: tudor.ambarus@linaro.org Subject: [PATCH v2 2/2] ext4: refuse to create ea block when umounted Date: Tue, 3 Jan 2023 09:45:17 +0800 Message-Id: <20230103014517.495275-3-jun.nie@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230103014517.495275-1-jun.nie@linaro.org> References: <20230103014517.495275-1-jun.nie@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753964020426415394?= X-GMAIL-MSGID: =?utf-8?q?1753964020426415394?= |
Series |
optimize ea_inode block expansion to fix panic
|
|
Commit Message
Jun Nie
Jan. 3, 2023, 1:45 a.m. UTC
The ea block expansion need to access s_root while it is
already set as NULL when umount is triggered. Refuse this
request to avoid panic.
Reported-by: syzbot+2dacb8f015bf1420155f@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=3613786cb88c93aa1c6a279b1df6a7b201347d08
Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
fs/ext4/xattr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 235a517d9c17..b350510b798c 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1422,6 +1422,13 @@ static struct inode *ext4_xattr_inode_create(handle_t *handle, uid_t owner[2] = { i_uid_read(inode), i_gid_read(inode) }; int err; + if (inode->i_sb->s_root == NULL) { + ext4_warning(inode->i_sb, + "refuse to create EA inode when umounting"); + WARN_ON(1); + return ERR_PTR(-EINVAL); + } + /* * Let the next inode be the goal, so we try and allocate the EA inode * in the same group, or nearby one.