From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-m16.yeah.net (mail-m16.yeah.net [220.197.32.16]) (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 9D40D13D8B1 for ; Sat, 11 Apr 2026 08:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775894504; cv=none; b=bj8wVLKnjqhHouAZgaQ4JCllhpx8FieoGh7j6RFSWIhSXjDk3sxRz0zV5kul7oM3Dswi99nxa0wvsC6YMGBXBS9DgKGTqNEAbNdGNR3T0IXN8fCDvRVvz+/1g1sqPEO/xEZ5HXweT7/Ed4WQlcwdc/7E9kLzOSJT1KzCzyHRjGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775894504; c=relaxed/simple; bh=Nmmzw7y6TwFbUJ5G641noVSO8Ntr5DbGN10hNJc9IM8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WipSJAc2fSGQbJQ6ICaDSUIo4GtLK8C/OrbC81aIK75IAZKoAFIaLyRxG335ZUbkpczREXg9SHczJdq78f/rgf8xxex3iv+x7j34ziGtiPxsmkdrZbcrwvHSdtzTQTeb1ugbMrJleQiftkGIQvib0ubo48UitdeGOa1IQ1sxmCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yeah.net; spf=pass smtp.mailfrom=yeah.net; dkim=pass (1024-bit key) header.d=yeah.net header.i=@yeah.net header.b=DC6q5e/3; arc=none smtp.client-ip=220.197.32.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yeah.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yeah.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yeah.net header.i=@yeah.net header.b="DC6q5e/3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=dU m/wjGM195ZfEE1Q1vdo55Sno6RAbrzWPlFm+iSXjg=; b=DC6q5e/3nZKwzAS4TG z6MnkT8Ec8Z5N3y6oPddxonh2cjb10yW2RjwWNtwxXAJMS1R9W2Qzl4oNQAEgkwo FzSk/wQxtb8o9iVWhOEzAE/ESrOHvNuNe0VJlUPt3oRWonb/FWWgCwAzrJnxMo0N xVNLVa6N6dUD7fxh9oP1oh4Po= Received: from zhang.. (unknown []) by gzsmtp2 (Coremail) with UTF8SMTPSA id Ms8vCgDnr6HQ_9lpMvA8AQ--.37648S4; Sat, 11 Apr 2026 16:01:25 +0800 (CST) From: Ziran Zhang To: hirofumi@mail.parknet.co.jp Cc: linux-kernel@vger.kernel.org, Ziran Zhang Subject: [PATCH] FAT: Allow 0xE9 near jump in fat_read_static_bpb() Date: Sat, 11 Apr 2026 16:01:15 +0800 Message-ID: <20260411080115.5517-1-zhangcoder@yeah.net> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:Ms8vCgDnr6HQ_9lpMvA8AQ--.37648S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7Xw4ktFyxZFy5uw1DGry8Zrb_yoW8Jr4xpr 1UJa4fWF4kta47ua1xGw4qqF1YqFWxtFW7GFWrA3y2kws0vFWY9F1qkF9IyFWxJr1kZ3yY qF4j9Fy7XrnayFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zR1KZJUUUUU= X-CM-SenderInfo: x2kd0wpfrgv2o61htxgoqh3/1tbiORYGxmnZ-9YBowAA3U The fat_read_static_bpb() only accepts a short jump as a valid bootstrap code signature for DOS 1.x volumes when the dos1xfloppy mount option is used. However, according to the Microsoft fatgen103.doc, the BS_jmpBoot field has two allowed forms: 0xEB 0x?? 0x90 (short jump + NOP) and 0xE9 0x?? 0x?? (near jump). The specification explicitly states that either form is acceptable. This patch relaxes the check to also accept 0xE9 as the first byte of the jump instruction. Signed-off-by: Ziran Zhang --- fs/fat/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 28f78df08..0f64552e2 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1479,8 +1479,8 @@ static int fat_read_static_bpb(struct super_block *sb, int error = -EINVAL; unsigned i; - /* 16-bit DOS 1.x reliably wrote bootstrap short-jmp code */ - if (b->ignored[0] != 0xeb || b->ignored[2] != 0x90) { + /* 16-bit DOS 1.x reliably wrote bootstrap short-jmp or near-jmp code */ + if ((b->ignored[0] != 0xeb || b->ignored[2] != 0x90) && (b->ignored[0] != 0xe9)) { if (!silent) fat_msg(sb, KERN_ERR, "%s; no bootstrapping code", notdos1x); -- 2.43.0