From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 3ED4536CE19 for ; Sun, 9 Aug 2026 16:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786292692; cv=none; b=Fnk6RILdWgXGKXA1+Y1b1chfM9T1599CGRvAnJy6bFBuKlVbmxoh04bP/iFs2S4qkl0CJ/7RmoRWlYkWjljJoAC/Me8wLuDOyltAkqaC2/iG7i0jN6CySG1EpO4p2LRg8Rik8kqCrczGf31RAnVFy/BlXo12ChWTFBRfI8Q2GfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786292692; c=relaxed/simple; bh=cwwb5nITHtXa2CEl8dki2kO1JkWBrSuoRMvXj5sMrbM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bu1hFnTdU2frk2bGnYn/3cfHqFLfFdteCJ8f0ZUXJzC+bX2E9ZhiLZJUJOyCtKwLveiWMs3KN6891gayntTK3Wm1vDmv7Gaa5BtrhQ3jlzlmqXxIXDwG38UnNdFvDT0q5DDhskdJuLtFr3YSwScH652ui6sjaI/JEWlr9Qj2+gI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YpWjhLri; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YpWjhLri" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786292688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4fTW3NKCOnb0Rnw5WpgqtZWsYcNgZWfC8uC6+Vx2Iuw=; b=YpWjhLrijR2mZ1Pkdzk2PKAe73zjTpD6OPzfJ3mcWmm3lMbNWZOkcX0dKv47XfOe/xkpcD O0uWn55eIQMR7uccaALc1U0umAgulN4uzQ+8fXDubqwuq5q+lFP5TJd+dnK8Huw+lqGVTE qN2bu754u2ythKM8KBEvWEl3Xe7T7/A= From: Thorsten Blum To: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Sourabh Jain , Hari Bathini , Aditya Gupta , Jinjie Ruan , Thiago Jung Bauermann Cc: Thorsten Blum , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/kexec_file: Use inclusive range checks in add_usable_mem() Date: Sun, 9 Aug 2026 18:24:01 +0200 Message-ID: <20260809162403.18142-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1060; i=thorsten.blum@linux.dev; h=from:subject; bh=cwwb5nITHtXa2CEl8dki2kO1JkWBrSuoRMvXj5sMrbM=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFkVKxd7sS0tj7i17KRS04UXgtMuLtvdbC0d/8OnOaA++ OPafbvZOkpZGMS4GGTFFFkezPoxw7e0pnKTScROmDmsTCBDGLg4BWAiHtmMDHvPeWqaLWLeOEep V1d7A2/gH/lAG1ktbYOcE/N68+RuNzEyLEmdWLbr7LZcTXPH7/POPIk/MtV8zqtyrkN/fxy8oZ9 ozQQA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT add_usable_mem() adds usable memory ranges for the kdump kernel. The ranges are inclusive, but the partial overlap check uses exclusive comparisons. This skips ranges with base == loc_end or end == loc_base. Use inclusive comparisons instead. Fixes: 7c64e21a1c5a ("powerpc/kexec_file: Restrict memory usage of kdump kernel") Signed-off-by: Thorsten Blum --- arch/powerpc/kexec/file_load_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c index 8c72e12ea44e..f9e872693ca7 100644 --- a/arch/powerpc/kexec/file_load_64.c +++ b/arch/powerpc/kexec/file_load_64.c @@ -113,7 +113,7 @@ static int add_usable_mem(struct umem_info *um_info, u64 base, u64 end) loc_end = um_info->ranges[i].end; if (loc_base >= base && loc_end <= end) add = true; - else if (base < loc_end && end > loc_base) { + else if (base <= loc_end && end >= loc_base) { if (loc_base < base) loc_base = base; if (loc_end > end)