Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2117362rdb; Sun, 24 Dec 2023 18:47:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFg+kUK4ciW2LR+5KPqU6yCOMq2YsJDeabMyx5GKNY8Reu/PfmzgW1xgbdAfjCmI3TTO3u4 X-Received: by 2002:a05:622a:1055:b0:425:77ca:5798 with SMTP id f21-20020a05622a105500b0042577ca5798mr8659091qte.102.1703472437228; Sun, 24 Dec 2023 18:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703472437; cv=none; d=google.com; s=arc-20160816; b=rTSSSeNIGSGgQSHUrMVqXCfWAHNNFM13wpJMJEQdjRNAFczCH1w8hXe7WdjxXl2xbs p7cxxQsq7XoWm41emg1NPocyGQXgv61sfmdTLAjnT4c5PkG/nxp4JG81FDuClDtld/NC YeZ4vJsDYQwyY9Sv7fVBtCS4MQNnaI3y21oNq8ksZKs8+0f4zwUM6INS6gNHno/RxzaH kB43sCJUUddjI2AaNkImw5cHMxsg1VMt5B1teZjKvR2BQC1kFgqtgz5yJ0u/tDw+Nos3 M/UenkH5pLrKIDmcDbt8Y4kdNw320hFoKTxAZOePz9XoT5lI4EpsJuFEFa7bCJD9FEem DqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=YEYR+7mV9wQged33TrHhdhS2A9jENxg5c6C8Pfb8ki8=; fh=Cpe9dHDTOHDxbqLs82Bou6ZnFZjFut933KZyreeKFVU=; b=VYUKuX33PYQ5r/1BkoDdQ4WGM7ygaWcPj0U81yg+7wmdGzzw2xzJrVapMhWbPoUfXj 2Z3Z0RcLoNzn1903TzBzlo0hsSdVRLNo+3S8bZOqbcB8ZdfdAMaHGztgMNMPU6YTxU55 L9b8fVj7o9LXStU3K7z++1Io+ySlKTEzyxlvhxJoLts33FfKSwyPCsB01aNC2zdnSDoB HPiDnritOrcuIuQyp83oh9mILewFWekGnNkxBNb5Er8PWWTS0ReKlF8s1NKBzAD4+nPQ tbjMue2dv5xGavUFlFu1DzWo7O9D0PU+nb52WiP+B6tB8PXBr6syz66PYbLmF2RM/RYb Tj3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-570-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t22-20020a05622a149600b004258446cd7asi9839641qtx.117.2023.12.24.18.47.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 18:47:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-570-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-570-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE9151C2152C for ; Mon, 25 Dec 2023 02:47:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31FA1A57; Mon, 25 Dec 2023 02:47:09 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 294AE365; Mon, 25 Dec 2023 02:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Sz2Ng2jmJz1wpDM; Mon, 25 Dec 2023 10:46:43 +0800 (CST) Received: from dggpeml500021.china.huawei.com (unknown [7.185.36.21]) by mail.maildlp.com (Postfix) with ESMTPS id 0F46B1A01A0; Mon, 25 Dec 2023 10:46:48 +0800 (CST) Received: from [10.174.177.174] (10.174.177.174) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 25 Dec 2023 10:46:35 +0800 Message-ID: <36a7c036-c268-0627-cb2d-a737784da62e@huawei.com> Date: Mon, 25 Dec 2023 10:46:35 +0800 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH] ext4: fix WARNING in lock_two_nondirectories Content-Language: en-US To: Theodore Ts'o CC: Edward Adam Davis , , , , , , , yangerkun , Baokun Li References: <000000000000e17185060c8caaad@google.com> <20231225021136.GC491196@mit.edu> From: Baokun Li In-Reply-To: <20231225021136.GC491196@mit.edu> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500021.china.huawei.com (7.185.36.21) On 2023/12/25 10:11, Theodore Ts'o wrote: > On Mon, Dec 25, 2023 at 09:38:51AM +0800, Baokun Li wrote: >> Marking the boot loader inode as a bad inode here is useless, >> EXT4_IGET_BAD allows us to get a bad boot loader inode. >> In my opinion, it doesn't make sense to call lock_two_nondirectories() >> here to determine if the inode is a regular file or not, since the logic >> for dealing with non-regular files comes after the locking, so calling >> lock_two_inodes() directly here will suffice. > This is all very silly, and why I consider this sort of thing pure > syzkaller noise. It really doesn't protect against any real threat, > and it encourages people to put all sorts of random crud in kernel > code, all in the name of trying to shut up syzbot. Indeed, the warning is meaningless, but it is undeniable that if the user can easily trigger the warning, something is wrong with the code. > If we *are* going to care about shutting up syzkaller, the right > approach is to simply add a check in swap_inode_boot_loader() which > causes it to call ext4_error() and declare the file system corrupted > if the bootloader inode is not a regular file, and then return > -EFSCORRUPTED. > > We don't need to add random hacks to ext4_iget(), or in other places... > > - Ted Without considering the case where the boot loader inode is uninitialized, I think this is fine and the logic to determine if the boot loader inode is initialized and to initialize it can be removed. Merry Christmas! -- With Best Regards, Baokun Li .