Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2117889rdb; Sun, 24 Dec 2023 18:49:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGC922hIRq3vBJpVBRhN0odpzn8cnHjL4YoUSk6QEs/GjPdIvib3E0ENi3DjJpwRvFAkjW1 X-Received: by 2002:a17:902:ea85:b0:1d0:b5a8:f6f4 with SMTP id x5-20020a170902ea8500b001d0b5a8f6f4mr5465628plb.23.1703472586099; Sun, 24 Dec 2023 18:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703472586; cv=none; d=google.com; s=arc-20160816; b=OiA7CKoBKjpJwUXu7de4yVRulHh2tCx5ETmZbQtZj+4MVPhLHD9vvzsIpIhIDyuZLM LCDJ9MOGcQl2cw712G+Ydt4rtT1cMkQLpLEv1ymZeVwDD7+3SZ8saH8cZOH0u2I3BGMR loK0d0U6DMiqVlZpAOuVTb6xRT07pNaGtgqOddyuBgtj/sHTgGHh6eYlRy2VSnSXOgAl oEaTlIqacsDrKZ0PIfC5+z19NnWX84fYAbla1pRh7mWqFFtqPD4TxuwYI7qOo9qwF2cd ACKaCaTbMcl/gjtovyVcMJsKucq5vlkXqcj+gcWk0zLl8e7n2dePcpsfwjMNFxUsaYPA pyMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OdpFpqqpJ89dj3MYT6e+L3YmSv6NrIhp5NNwXxiXfpI=; fh=J2ViD10dPSj6eeOf5uY6UA/O8dBYT6qAVx30C8gbtdw=; b=GS3oJExs1KqwB4inr86n9/c91xqm8GXGIjm5guv+KYAbCSgIjRwn9qt4ulHK52jMFi VTUaWjA6LS/v4NoO3REeE1mg1TaRnJVq1L3ODfxP7gaa0H9cBCXUsoD5tzzKHyFlixNV VzilnZBORWbsP4Ol6+tqei+NS3LcPnnLK1YKo8ccC2lQwQs95GxK7Q5gN6cLxTpBCkbW +cTzBLQx9lX0zHFHyX0GQpY2R1KDr4QRmomBPgdgTlnY+0Hbwt0gKgs/NZsEfXfFobyv dBM+34E1gLpb6qY3QJG2Xz7vUaDuNwlct8Mu9Nb6UiU9Pree/D9BqFe8+1mm3Qav1vtC wfrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=ersVXDjS; spf=pass (google.com: domain of linux-ext4+bounces-571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g4-20020a17090adac400b002861c962e15si7383627pjx.15.2023.12.24.18.49.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 18:49:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=ersVXDjS; spf=pass (google.com: domain of linux-ext4+bounces-571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 99A95B21105 for ; Mon, 25 Dec 2023 02:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1CD515C9; Mon, 25 Dec 2023 02:49:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="ersVXDjS" X-Original-To: linux-ext4@vger.kernel.org Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E21F15B0 for ; Mon, 25 Dec 2023 02:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Received: from cwcc.thunk.org (pool-173-48-113-111.bstnma.fios.verizon.net [173.48.113.111]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 3BP2n6wB016557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 24 Dec 2023 21:49:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1703472549; bh=OdpFpqqpJ89dj3MYT6e+L3YmSv6NrIhp5NNwXxiXfpI=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=ersVXDjSrH6gZn90dOHWFqQOl4XSj93gjAOQ43HaEgbw8F2nMBnX39IR1oj6frqun p61Zmw0KLT7bINJtuKHp1H136TBDdKc7Xe5RGEYxByfzmDNsNv8Vr6zo2RExIQeV0+ A2Oq+RfEZ1+L8mINKsYx3XVjP1iZSnWk1NZ0SpOKkXwJetRBXiWDpD7Jmkzv9Q8tgJ jvQVp+h/J8UFe4QdgeypF7Nz8BLP2aeERtGkp7k9MKFnyQdBnOIf5+3FP0j48UhKtE +po+W6Y+9oD8htGFwXCicrv98Y4jnaxFYX8xWH4Y6J40rG78h7QCyrcBnXeUn1INUK 4nIUtm8fOpZ8g== Received: by cwcc.thunk.org (Postfix, from userid 15806) id C35A115C18E6; Sun, 24 Dec 2023 21:49:06 -0500 (EST) Date: Sun, 24 Dec 2023 21:49:06 -0500 From: "Theodore Ts'o" To: Baokun Li Cc: Al Viro , Edward Adam Davis , syzbot+2c4a3b922a860084cc7f@syzkaller.appspotmail.com, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, yangerkun Subject: Re: [PATCH] ext4: fix WARNING in lock_two_nondirectories Message-ID: <20231225024906.GD491196@mit.edu> References: <000000000000e17185060c8caaad@google.com> <20231225020754.GE1674809@ZenIV> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Dec 25, 2023 at 10:33:20AM +0800, Baokun Li wrote: > Since in the current logic we update the boot loader file via > swap_inode_boot_loader(), however the boot loader inode on disk > may be uninitialized and may be garbage data, so we allow to get a > bad boot loader inode and then initialize it and swap it with the boot > loader file to be set. > When reinitializing the bad boot loader inode, something like an > inode type conversion may occur. Yes, but the boot laoder inode is *either* all zeros, or a regular file. If it's a directory, then it's a malicious syzbot trying to mess with our minds. Aside from the warning, it's pretty harmless, but it will very likely result in a corrupted file system --- but the file system was corrupted in the first place. So who cares? Just check to make sure that i_mode is either 0, or regular file, and return EFSCORRUPTEd, and we're done. - Ted