From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 076D73FF8A5 for ; Mon, 10 Aug 2026 14:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786373962; cv=none; b=k9xq2lsSMfKkU73j/NtX/zKXTtwCi5nziXvMUbn9Dc7fLh0IAr1EysZTEgPxkdYJCaSvz32LiJjDAwoYbI4UktzOnqfe2WYvAyO9D6e0jHla94aJHwW3nTZKbJUOmJI4N065NobcEW/lXhOboscP8+yNgO14VsMT9FknBoyTQs0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786373962; c=relaxed/simple; bh=RxeXQNEjeIoAq+PW4Rv9liZkIgOa04vUqgNKQcRM6eo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Vddlnr4hVCdQh5vt8qVshEBFoLxrznIFxgFH1mdkUYo5tRFs1jQby3xGt/MCXY7X5TWbUMHFJM0RVcd5L1NrTHSBOD4LvSxWtwgVux6GvLVFlUvO7n7dw/l31ZhkLP0iYzwamdpPcSAsI7Uuji9cdjSMmBfJSX1Ubqny/+96+UQ= 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=If0MMZ6d; arc=none smtp.client-ip=91.218.175.186 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="If0MMZ6d" 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=1786373951; 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=QBSVQCIcPTFPONPO0r2svBU7MgEW/L0OhswnDVKP3Vw=; b=If0MMZ6d/FLOZM1OKhoy3Z5P/YMKFOHxDwWoUxRVcBSGEHa/8kSJgCOFKisu3CcxXN2LNx dUeuUpjfwgOe4F9Ms0VKJbNUJpVe52/65pV7toGO/AW+jqSl6VN4vkBKEdr4WkK7l0h1Yq d4YswN74XBtS6+q87oR+fyKh1hAejVc= From: Thorsten Blum To: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Sourabh Jain , Hari Bathini , Aditya Gupta , Jinjie Ruan , Andrew Morton Cc: Thorsten Blum , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/kexec_file: Use inclusive range checks for excluded memory Date: Mon, 10 Aug 2026 16:58:27 +0200 Message-ID: <20260810145827.157972-3-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=1236; i=thorsten.blum@linux.dev; h=from:subject; bh=RxeXQNEjeIoAq+PW4Rv9liZkIgOa04vUqgNKQcRM6eo=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmVz4W3s9jGqfmaRZxifKS3Zl3WrndLklbsjljscCegU 1OcY2ZdRykLgxgXg6yYIsuDWT9m+JbWVG4yidgJM4eVCWQIAxenAExkCyfD/4glT2r3uBy2WX9g v1bq07/uazZsqz/49ClrrXzaisWGO78yMrQyHu3PYebwKoxY0u/0WCrSfAkX/8TeE+6Vaw44puc s5QEA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT arch_check_excluded_range() checks if a kexec segment overlaps an excluded memory range. Both ranges use inclusive end addresses, but the overlap check uses exclusive comparisons. This skips ranges with start == ->ranges[i].end or end == ->ranges[i].start. Use inclusive comparisons instead. Fixes: 6e5250eaa665 ("powerpc/crash: use generic APIs to locate memory hole for kdump") Signed-off-by: Thorsten Blum --- Sashiko found this issue when reviewing another patch: https://sashiko.dev/#/patchset/20260809162403.18142-2-thorsten.blum%40linux.dev --- 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 40b74cc4ed3e..32e2b7412a9f 100644 --- a/arch/powerpc/kexec/file_load_64.c +++ b/arch/powerpc/kexec/file_load_64.c @@ -58,7 +58,7 @@ int arch_check_excluded_range(struct kimage *image, unsigned long start, emem = image->arch.exclude_ranges; for (i = 0; i < emem->nr_ranges; i++) - if (start < emem->ranges[i].end && end > emem->ranges[i].start) + if (start <= emem->ranges[i].end && end >= emem->ranges[i].start) return 1; return 0;