From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-m16.yeah.net (mail-m16.yeah.net [220.197.32.19]) (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 76CF81D95A3 for ; Sun, 12 Apr 2026 07:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775977318; cv=none; b=UduBCOeQO557xrbOAN+wnlfS604jZNVUmpYRcRMVqFF/OffbKKMPBfb8sFdPIU/7qJcwVFg53ZFe8GGdnb6m4JedfiDfcaKVDNxQwgxIHoZgfNnmBwXi8EDlDCHSVrstgrkcqY+6I9pDGyMRaP31XQYmZk1JoOEDFp0+CFPbuPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775977318; c=relaxed/simple; bh=scKPkj9d+0YLnU6T7Xv/UCB5Yzx1lqVxQjR0QbTj83k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=poBeDJEsrsU/zlRLGemIocbrwWDmiz40AR/LDYJUQ4PzgGlBmsQTlMtm0IMlQ3Pq5WhxaIKHDZBHSgMWj1Gvu4s99csZ0SopJb0VO8YIFRJ7fwTU3ub+nW3e1U2kDno6fm0rFi2YPtHWqVYgNexQP7q7ajoxsRAJi6LGrbXa3e0= 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=NBIA44BV; arc=none smtp.client-ip=220.197.32.19 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="NBIA44BV" 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=XT t6HK0GHWzeHQ1TgFzbpBOmIgYfM90kQbgbI0CouYU=; b=NBIA44BVsJccCIlFg2 IXrq5/wCFQN7JYuSHhA5wT9maptjCI9wHfdf2miwPBBggVHQxXUUh9hHkzRUfYZa o3lbTMO+EVYO7eCsIQjbGp9quYHRbej2Qg7bV4jFe5Y6V99PfUzBDLrfZzmIXD8/ a4iU/ufMYiUyjVvjFSqT/sY8A= Received: from zhang.. (unknown []) by gzsmtp2 (Coremail) with UTF8SMTPSA id Ms8vCgD3D5ZMQ9tpkENIAQ--.50687S4; Sun, 12 Apr 2026 15:01:35 +0800 (CST) From: Ziran Zhang To: hirofumi@mail.parknet.co.jp Cc: zhangcoder@yeah.net, linux-kernel@vger.kernel.org Subject: [PATCH v4] FAT: Allow 0xE9 near jump in fat_read_static_bpb() Date: Sun, 12 Apr 2026 14:59:41 +0800 Message-ID: <20260412070109.5197-1-zhangcoder@yeah.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <87wlyclmvr.fsf@mail.parknet.co.jp> References: <87wlyclmvr.fsf@mail.parknet.co.jp> 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:Ms8vCgD3D5ZMQ9tpkENIAQ--.50687S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr13tr4DAF4xCw45Zr17GFg_yoW8GF47pr 18Ja4xWF4kta47Wa1xGw4qqF1FgF4ftFWxGFWrA342kws0qa4Y93ZFkF9rtFWxGrs7C3yY qF4Y9F17Xr1Sya7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zROo7NUUUUU= X-CM-SenderInfo: x2kd0wpfrgv2o61htxgoqh3/1tbiNw819WnbQ0-XPAAA3t 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. Changes in v4: - Add original commit log Signed-off-by: Ziran Zhang --- > Could you add original commit log, instead of changelog? > > Thanks. Done! Please ignore the earlier erroneous v2 v2 and v3. fs/fat/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 28f78df08..0e7d106ea 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1479,8 +1479,9 @@ 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