From nobody Sat Oct 4 21:02:18 2025 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) (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 25FDC32C85 for ; Tue, 12 Aug 2025 15:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.181.97.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755011876; cv=none; b=tPIBr63p5NMwIXuvc5GSHaVoWdS4NsU+4Vj2y0KbaJ+EPDGaVQZvtJ51vyccx6R1fT2J0v+0/r7VDBcZCT1RTDow7dgkjGdWNNm1DR4KDJIIBgAMjjGjCQMrr3oJI7FHo36uPJY70JvaeBcIbsl817/vDNxH/MBA7+oZ4ZvOnIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755011876; c=relaxed/simple; bh=3ESvNRCybsKcvs+ZZZTszo0rqdVNcvFp/lRH5lpw9jE=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=ERjmC2yGTplEeTbjd9Vj1iCW1fwjP2MXrryzEf7vO5bqsZ9cFlWL+TtGFYSAwjhlDK0uTes8GDDqgbxlaDO/aL/plKq30fKr4sESOBzFCPQUCXm6T8fM0riWEjg8T0kcR0fZWTWaxPJGtVvWpZxhN9+uW3v6a2E4ggqapntB6iw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp; arc=none smtp.client-ip=202.181.97.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp Received: from www262.sakura.ne.jp (localhost [127.0.0.1]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 57CFHjxN002952; Wed, 13 Aug 2025 00:17:45 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from [192.168.1.10] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 57CFHiYF002949 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Aug 2025 00:17:44 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Wed, 13 Aug 2025 00:17:44 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Christian Brauner , LKML From: Tetsuo Handa Subject: [PATCH] minixfs: Verify inode mode when loading from disk Content-Transfer-Encoding: quoted-printable X-Virus-Status: clean X-Anti-Virus-Server: fsav203.rs.sakura.ne.jp Content-Type: text/plain; charset="utf-8" The inode mode loaded from corrupted disk can be invalid. Do like what commit 0a9e74051313 ("isofs: Verify inode mode when loading from disk") does. Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=3D895c23f6917da440ed0d Signed-off-by: Tetsuo Handa --- fs/minix/inode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/minix/inode.c b/fs/minix/inode.c index df9d11479caf..32db676127a9 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -492,8 +492,14 @@ void minix_set_inode(struct inode *inode, dev_t rdev) inode->i_op =3D &minix_symlink_inode_operations; inode_nohighmem(inode); inode->i_mapping->a_ops =3D &minix_aops; - } else + } else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) || + S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { init_special_inode(inode, inode->i_mode, rdev); + } else { + printk(KERN_DEBUG "MINIX-fs: Invalid file type 0%04o for inode %lu.\n", + inode->i_mode, inode->i_ino); + make_bad_inode(inode); + } } =20 /* --=20 2.50.1