Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7677749rwl; Fri, 30 Dec 2022 12:23:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXsA8iiTMQGHgR45UNGXXU1Fb5PA6Z6Yp+XZW3/AapFQbxc3nuPon72o/rqH2MqcgerRb7ra X-Received: by 2002:a17:906:3ac3:b0:844:1d1d:f7 with SMTP id z3-20020a1709063ac300b008441d1d00f7mr23567055ejd.23.1672431799721; Fri, 30 Dec 2022 12:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672431799; cv=none; d=google.com; s=arc-20160816; b=jLeQ9555X4kxsZ0cvA6dUfvwg1eHyx5C1l+3ZRDx3mKzyPJCl9h2/LQfWI249j5GdS 74XoQjBrGnSK5TAuGF5NOhXNIAgfILNzsAQm6JdguBUjemQebLune1Zd2HMaeah9Tqmx 6FYysymHIVeN4GgLcR5JDIpfF3+4kelAIHCwBMM9agmL4sLRY6IRUNaKFKxoXF5FRvLR 394Vpj/5sfS6F1SElP5y3NAi8Sgvg0bBaBHbp3mws23ofvJIoAnF0lHGKkE4NvIasVtN OziyJPqXmltK2wmUuXXMXxSMPPC7uJT2Y99b9H/fuWO9FRAbamuYqaazy/JyRSJvN/ax OCFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NMaxjQJ57vyHK2jvHACwDOVN21Ak5dfrAsJz8i3XUKs=; b=vbdXQxj61NJJ7kXX0o70W+bfFoP0BodK4/8hQuiV22WpJPuw3jh/ETLBjX/QvJ/l8h sT1S0Y/1zTi6BMsS298aXyDtnAYZDAh5kzjoF8wv0pc5L24thl2AWf472Xho8roGjy8O 9lDrVyxJBstOnm1mFRYNBhcACc4MHfMXBfWly1pKPVymmm6aI+048TiLdpkX+89GFgku HeA0e31lkJD4vHYK6DWng2U2SslaU4s6aynAXQF2KWM0vGbjiy2mHlVgk5dOYNsYze10 agnH7a6vTPM62t0YVLrLQli9U8imyYmBzpn2Kft0ZyN1FX83ntM01LNDLnrechK5QMB7 /rKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Q7qtzJQ/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090658c800b0084c7590c24esi8846307ejs.139.2022.12.30.12.22.51; Fri, 30 Dec 2022 12:23:19 -0800 (PST) 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=pass header.i=@kernel.org header.s=k20201202 header.b="Q7qtzJQ/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235453AbiL3UNa (ORCPT + 99 others); Fri, 30 Dec 2022 15:13:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiL3UNa (ORCPT ); Fri, 30 Dec 2022 15:13:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C5611AA38; Fri, 30 Dec 2022 12:13:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD2B561BCB; Fri, 30 Dec 2022 20:13:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C922C433EF; Fri, 30 Dec 2022 20:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672431207; bh=EfI7l5SQjlOPh7QWIN2CUcMKcJaGYutOHFmQnj1qNNU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q7qtzJQ/OQ2UE66v3GVjpd1OInb1g16GuxQCQ62PBFRbr3U6dJqQfJODjNcAkwreE 0QHGQ4SwikFyt0hUcM63UfZ1lE+01XPaPV1BLsGSP8m5kb+sMWDl1jGSpLYu0gUZnM Ejaiy3j9tiUdQTyX+aZ6pRIAwUTIZWSrC3YCly4RP62ZDSXZLZq6FtzIHOmGG2+V0l aq+yCAaiSvtI8bEedexIuA4foBE6sgNtfJLc4xlIL5k/fxU67LnFTLL0pM0S3+I682 hYP6LhcJjlYOIaIqFQRj4P286blawSrTzUIJdX8aTANFJc+enl2qVgXiKeQkxFn5Tt crVxAVI7YXOJQ== Date: Fri, 30 Dec 2022 12:13:25 -0800 From: Eric Biggers To: Jun Nie Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, tudor.ambarus@linaro.org Subject: Re: [PATCH 2/2] ext4: refuse to create ea block when umounted Message-ID: References: <20221230110016.476621-1-jun.nie@linaro.org> <20221230110016.476621-2-jun.nie@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221230110016.476621-2-jun.nie@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 30, 2022 at 07:00:16PM +0800, Jun Nie wrote: > 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 > --- > fs/ext4/xattr.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c > index 235a517d9c17..ac58494e49b6 100644 > --- a/fs/ext4/xattr.c > +++ b/fs/ext4/xattr.c > @@ -1422,6 +1422,12 @@ 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_error(inode->i_sb, > + "refuse to create EA inode when umounting"); > + return ERR_PTR(-EINVAL); > + } > + Why is an xattr being set during unmount? - Eric