Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796434305; b=nJQSiT2toHjJoSOgktOu/hsL64lTznoAyhH60ejJBWmDT+9wAFU18ptwqUXXipFWi66X vyltMKKOmEz6TPHkemN0nTRRK7W8GhrBL4OKEsM7dtXsa06MLeMnBE/HmrWUFQfTcSPT0 7112KsCZII1ndrQpwO3KJPhLyZZgiIGTEooz8hOwQod/Up3Mh22TMQ63IoqYQjY865Di6 656d2UYUe83b6roY8AKhcu99RqYRZGf/QnW814sbZ9i8kCfryemb+chuuiJwQZqpN4Vaw MuR2PhUrIJ9NcLkajeAKjxJPe5Ovyr7i2vgulPOsxJayheAaN/rcssakuV+eHNqSjpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796434305; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=du0K4kYzjtqroTkOrO9BewjhDxCLIvCss9e85JIa1XA=; b=PP/i4gaQTOkZIUoLfTNBZmT2/JRJboH7brfLtlDSFu4FBrF5PcU3RSX4Vh2mUcILSjT4 t/vO1rFArijm0kJ903Oxh0m3JAHCsYMh04WeY1iuHjiRpInmLmmKtzwO4AkNOJu0k1hi2 ln/7IQcbzuA+cWoLYzGAtuD8Ubp37pDcOkXyNIe+pselaSKFOyHoLqmJGsuHpeyawz1wX 2Qn3mAbUCo1lOnhMEy2fXDcHdgfG1w46rbXIRg1dqJBbz+Vqzm76EVrK/UGMgHrWafn6Q ORssfoYDPc54TgW3PvPV026jJQWz/HZpz0v1F7QHFr5gFmvnQSSspyMsCfk3M3kWEiw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=dubeyko.com; spf=pass smtp.mailfrom=dubeyko.com; dkim=pass header.d=dubeyko-com.20260707.gappssmtp.com header.i=@dubeyko-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=GVCAIq8A; arc=none smtp.remote-ip=209.85.128.179 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE375606A68A for ; Sat, 5 Dec 2026 01:31:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BE375606A68A Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dubeyko.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dubeyko.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dubeyko-com.20260707.gappssmtp.com header.i=@dubeyko-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=GVCAIq8A Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-8b4d5e645d1so8945507b3.1 for ; Fri, 04 Dec 2026 17:31:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dubeyko-com.20260707.gappssmtp.com; s=20260707; t=1796434304; x=1797039104; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=du0K4kYzjtqroTkOrO9BewjhDxCLIvCss9e85JIa1XA=; b=GVCAIq8ALbQWVAyZyemwX/03l877+9staAg9q9+hMnWMzIx/AuemVkyWo1N7wgfmyX 5urVueUImd4wNfcu4AFyco+UJX1/OivdhJnC1JvdGwxBQoX2j1IClVNayRuKFOJFZO5K M5ct9b5zgJvO7asow7ODUuWtsKKETOPXT3I955h1bEQZexW5iYd08Bhou8wMSIV+pK/S fKYqhnLOlXR2obs3Kkh6VkRZ/Bx3II0t9jwKs6x37WfVwpcSCVTq2//+kPWFqNvEiLr5 4AXAwLBVZVs22ssI2ubZNXplZaqmaxq6sxY5LbqqleyQT4IqraWyNDEON6KCr9qmf+vb aOJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796434304; x=1797039104; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=du0K4kYzjtqroTkOrO9BewjhDxCLIvCss9e85JIa1XA=; b=BMp+CxBychVepTQEedBFrNsVwtmF6A51a5C5nJKkhocvvXoSzfwu4iZJHJ1QTR7Dc3 5eanykvTYw4eD+RCDXGCsM0ze10LQKxDeu1FL0uca/sAm4CZN9YyOj1kJFJKXh3DGeZp fvoC/whpDti1L+KkSHiXRwkzSmAcarb/x1xoHrzVrXmDAcMiiRXYI8hPWw4GjS3FrGFi Xeb5kk1tKvJIizf/rWeL3MRfZZWymxgEPXzqFMla5sd2j+Wkrvn58VZDtta1OTs8s3IT s4bDkkmPcRmsQQxHwIjzM9SFymZYu2xoIpPqG2yvhqbJ+GB+mH4RmuWOnbaDJWgYTUjm liLA== X-Gm-Message-State: AB4q+uES0L2Jt7Ka3o6iFwqNyFP5t8brwuzxG18nN6QC5rqAxKQmwgke omD/Q8dwsrkTppUNm4PO62QLBM4ohDk/yaZ6ubm8ncH/nB5xaKLQ9DwqoELsm4QggDc= X-Gm-Gg: AZFdTZcLNB6w18W6rjSuePzhCXU+GdjaN1x6KifA+190PmnHUACDl9bNk0NJeG+jPMb 1zIk6tA7IHMQogJb1pBMDANJlMyKWr9UZCOwrsWh64nG0QZjlIpgm/l7VGx7vEuLEgmIsyTIZgH sP1YRXpQPH+VT3YM9SOd+SfeMt7SDVDux6xnLiZXUF1api3iEv0HcVueeGqCdN5Ui4UB1uhUh8i onVMsG0iKLb8OcmVkfwxNwwDXyQKyny8FvFkxGO4dzyTMdger8mF7kD9nTVV333yypsokeMpVoR /ZsulTEl7iFXWqkARfGdCRPiWY+Gsbzek5+cxrub00055Z18cCKsnKknfhpLuQPcBUwiqCYbxty IuCuLpAx4YdAPome2KRrNMGx7DHKnxRbdk33AfIa0A1qUuJaMP3FgszU/U9CXnSRCWCnp9iiffV NBEXU5sbMyyxv6s7LKc8iMo+xYmY+Lh2rvwDkGgeHumKH6NaiFATwqCiUaRiWei4iafYRKejvbD aILHwce+P3ZVfBxWESS0hIAOu+6h5TFlXaNZ+y9wvfkptqUv2sOEQajJOGif1aCHXM/YZ0TBKeH MVsznOMcqFCxIGjp5CFqG8emSdyNm+4j/2eghsc4ORBabJzIF1z5ZMvx5UAb3weq4x04m1Q1jQt ELbXUP9cyGFvnlCA9ZOLYNRHsbDOJEErInfHUEJ/RYyLii8H7E0FayftD71+3jC6jRDjZZBpf X-Received: by 2002:a05:690c:6806:b0:8b2:ff8c:63b5 with SMTP id 00721157ae682-8b660d78611mr15773097b3.46.1796434303728; Fri, 04 Dec 2026 17:31:43 -0800 (PST) Received: from system76-laptop.attlocal.net ([2600:1700:6476:1430:d9f4:eaa9:479c:5d66]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b660e183acsm17228137b3.45.2026.12.04.17.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 17:31:42 -0800 (PST) From: Viacheslav Dubeyko To: glaubitz@physik.fu-berlin.de, frank.li@vivo.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, vdubeyko@coreweave.com, Viacheslav Dubeyko , stable@vger.kernel.org Subject: [PATCH 6/6] hfs: stop at the first matching entry of the old partition map Date: Fri, 4 Dec 2026 17:31:27 -0800 Message-ID: <20261205013127.1533652-7-slava@dubeyko.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261205013127.1533652-1-slava@dubeyko.com> References: <20261205013127.1533652-1-slava@dubeyko.com> X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When hfs_part_find() finds a matching "TFS1" entry in the old partition map, it adds the start of the partition to *part_start and sets *part_size, but it doesn't leave the loop. It goes on checking the rest of the 42 entries, so without the part= mount option every following "TFS1" entry adds its start to *part_start again. As a result, the MDB is looked for at the sum of the partition starts, which is not the start of any partition, and the size of the last entry is used with it. Also, hfs_part_valid() checks the following entries against the already shifted *part_start. The new partition map branch of hfs_part_find() and the hfsplus code stop at the first matching entry. Do the same for the old partition map. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Viacheslav Dubeyko Cc: stable@vger.kernel.org cc: John Paul Adrian Glaubitz cc: Yangtao Li cc: linux-fsdevel@vger.kernel.org --- fs/hfs/part_tbl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/hfs/part_tbl.c b/fs/hfs/part_tbl.c index 05c4c360bd68..5764e282b779 100644 --- a/fs/hfs/part_tbl.c +++ b/fs/hfs/part_tbl.c @@ -117,6 +117,7 @@ int hfs_part_find(struct super_block *sb, *part_start += entry_start; *part_size = entry_count; res = 0; + break; } } break; -- 2.53.0