Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5252848imu; Tue, 15 Jan 2019 14:08:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5RAzpoqgloFj2xGc1DOkLxSamBSNSxgUkGQ3iO7p1QOaKA8naNkswUkxEShIs78raqVUkU X-Received: by 2002:a62:43c1:: with SMTP id l62mr6418632pfi.22.1547590102142; Tue, 15 Jan 2019 14:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547590102; cv=none; d=google.com; s=arc-20160816; b=HyimdFiHs+zW2FJPxslFw9im/nbKVG6k/LuV/1T65k7a4QPZmgUO6iByjlkaIjzeBc G2PiLMu6TDnC78ESUPiZdhlD6LFmP5jpCDY7fCxeLOT+Z9t51e2matuL6Hftfn0PdW1C 9UmAwiFDKeiPeOfFe+37iB4GgChLXZIZz+5XPgmvpKu0YUmhqKf/syy8ZYmWwDwCPij8 vVoO1U9nbyrVolbSssgaXz8nNIXvpD12z8NosfPNKfmU9ubjgqdigocWGgnifMCzGoSJ LPAq07kKeYuUX1lp5XpZ2RoiP0w+J6Mik2eERYgclx84ZMgyeofzDyJ12GfDOwukdHLE hbbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WL7ByybdfV1YSi8zlf2X9GRU4L1IPOh/nlqwuw1Nfag=; b=NeWp4XYWybCFRfsoATBMuYKtl1Az793Oc4AHEk11LubBo02IQ7FCS4n1c8LsxueXl8 n6u6xwW7JRdcudck566O7k85dm1sd1YQDjVp7d6RE0J/zwoFwaqQa2owqWo5PL4EDAyJ jP2/n3J9wFVOtdG0h9umm+C2fTGeQzD8xvjtriJxUePalZ222/7Qs5m7yCBPj98UL5gv +WD39ODFBTFrd1R9tJz+Iyc5X93qIanppSzuEG2YiVi2MKZQVNFPRU5QZnTZC3dBhhn1 CMdnvO2bW9C3L07t/Z9I5jXr9ejh4U8SmlrdrWd3Ok3B/0UqOsVf8fu1A3CoT2frnNsB 825A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e2B9t6oh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si4196921pgf.452.2019.01.15.14.08.06; Tue, 15 Jan 2019 14:08:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e2B9t6oh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbfAOQpn (ORCPT + 99 others); Tue, 15 Jan 2019 11:45:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:35362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731001AbfAOQpi (ORCPT ); Tue, 15 Jan 2019 11:45:38 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DB5C20645; Tue, 15 Jan 2019 16:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570738; bh=Xc3tO199DYCbfHyAiJS5aB7ao/363biI37/MwB6zQfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e2B9t6oh6R82jJu6wMvj/4CYEEd4SOIQSK1FBwo3zbfJAMoECjKbCThUnhpapN3si CopaDA2qCvz4ohvz6Ak1q3uxjqnwWDTBf5UfHGEkv5BLBL3hhlVjxUNHFc4cAtOrc3 f+dyx97oOIWvfwyvkmF5I496NsLyipvVMDCuR+AI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , Dan Carpenter , stable@kernel.org Subject: [PATCH 4.20 52/57] ext4: fix special inode number checks in __ext4_iget() Date: Tue, 15 Jan 2019 17:36:33 +0100 Message-Id: <20190115154913.934973436@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit 191ce17876c9367819c4b0a25b503c0f6d9054d8 upstream. The check for special (reserved) inode number checks in __ext4_iget() was broken by commit 8a363970d1dc: ("ext4: avoid declaring fs inconsistent due to invalid file handles"). This was caused by a botched reversal of the sense of the flag now known as EXT4_IGET_SPECIAL (when it was previously named EXT4_IGET_NORMAL). Fix the logic appropriately. Fixes: 8a363970d1dc ("ext4: avoid declaring fs inconsistent...") Signed-off-by: Theodore Ts'o Reported-by: Dan Carpenter Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4834,7 +4834,7 @@ struct inode *__ext4_iget(struct super_b gid_t i_gid; projid_t i_projid; - if (((flags & EXT4_IGET_NORMAL) && + if ((!(flags & EXT4_IGET_SPECIAL) && (ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO)) || (ino < EXT4_ROOT_INO) || (ino > le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count))) {