From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 69FEC514770; Wed, 30 Sep 2026 16:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786425; cv=none; b=u9Yf9Xj8PvPJ8KPeVl5jkVGphpLWKsyndGK66SUv8I6tVUECZRCKV+zeFeM+Vo6u7NWJpjXUExjk5uoMR+mN9ixp7OJTOc6N38PKZMLfwvYNxygWqba6ux1rt/j40Ne07sxOE3CEPpJN35pkK5bFv1A47LVO6WkarX886XKnPD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786425; c=relaxed/simple; bh=FubMa7j6jI3ANCxKpe8iMGkK0oDf8M1VKq6lBLMxvX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YoARdXNkdh11aZwyBB6riSuyCWVLxXmfgW34x+x2fMoHwNHs1qadmnXOZhvy88/tNh7JC3BB0quQeSwl/+QJqvhXdueHeEnzVa7u1iHQ5zsO1L/uBCM9QLxh/X+KmnT9rac9xdskU4XUa8WYET492NJgqMFmUFwjy2mOS77D3nc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aNWVNbqS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="aNWVNbqS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB0631F000FF; Wed, 30 Sep 2026 16:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790786424; bh=80BAhV7OrEJiBBWoBkGdvATNeXqbfk56QdiVMVKu99A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aNWVNbqSn1mIQEYl0PrUy88o1nH0rb51I8h0MXYhWH9+Etgfty0pomk8n7hrmmg66 Wxzlm2KxRsX3NURlcWcRYMfLN2QDejf2/xQcQPI6L10bhBHebOLwXUhdGhgSrb0C2x M+te6OTy7WJL9QTn8+9HFvuMt9CIY2otTzifSi+4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Zaslonko , Peter Oberparleiter , Heiko Carstens , Sasha Levin Subject: [PATCH 6.1 857/982] s390/debug: Fix NULL pointer dereference in debug_info_copy() Date: Wed, 30 Sep 2026 17:26:33 +0200 Message-ID: <20260930152435.154360008@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikhail Zaslonko [ Upstream commit 012bfcd5a51082d5a65f096dfb9ca652b5267965 ] When debug_register_static() fails, it clears areas, active_pages and active_entries but leaves the area bounds unchanged. Copying such an area, either by opening its view file or via debug_dump(), makes debug_info_copy() dereference the NULL pointers. Skip the copy loop when the source has no areas. Closes: https://lore.kernel.org/r/20260903132123.12F271F00A3F@smtp.kernel.org Fixes: d72541f94512 ("s390/debug: add early tracing support") Signed-off-by: Mikhail Zaslonko Reviewed-by: Peter Oberparleiter Acked-by: Heiko Carstens Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/kernel/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index ea7c31b407023..1b23ff7162e5a 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -345,7 +345,8 @@ static debug_info_t *debug_info_copy(debug_info_t *in, int mode) debug_info_free(rc); } while (1); - if (mode == NO_AREAS) + /* debug_register_static() failure leaves areas NULL, bounds intact */ + if (mode == NO_AREAS || !in->areas) goto out; for (i = 0; i < in->nr_areas; i++) { -- 2.53.0