Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp118608ybg; Mon, 8 Jun 2020 18:07:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN5+CdgTBWp7+bbimoBkXXfSgQ/wg5ss66WQ41Ut+jXh29xN0+I/yNZmEenZtXDxYZtMUU X-Received: by 2002:a17:906:1b1a:: with SMTP id o26mr22724510ejg.176.1591664859516; Mon, 08 Jun 2020 18:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664859; cv=none; d=google.com; s=arc-20160816; b=AoayLEpE9Y4tSUIpfsOGj7MilucKrY8qtyBzh4aoY9lwnmLKG/MYgG6hdfZojcPEFW T8CYJzNaSm5PRELalRtTZeozaMcbCgQj8IQQqcjt9QtpDdh5k8KSgzHnzczcYMLs6NCP LY9gDEf+AFiHlCzJ/FyvUKxuipkHKX3OnGVJVNuIkKZhNt/hloIs4LmLX8FVYa9MGVd3 rgE4Hd8sl/U2ZMo+449J5EHcb8xvmeuTvjZBj2A4I4IrF2Dppz89aVbKILR0Cb5fdA3C IcaMtX5e3qyqyj3C5D5FCSUN5h4207VhyvBzaKr5eYpfh7Z/q0VfkIME17P3HQesDrc2 RCnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nJu5LhfbL/VsaU8ienkoSTQWStTmJ6j+jDE3oJYXfoA=; b=XmtpXungPQxBSwlioFW6720CzgKgwemLXo9Tvj1F1KH/6KXB7aUq5yCHA7D1jFr0HR 4tOBLaSK36p+MJ94CsouujLiXngwBK1Wtl/Xv/1pHiNlgzbkF2oxx7uWnoiJcQzKpLAn MB2RQv6mdnQYhH094BKPu7d6gpcdC9vpPsurBOJVWlC4HrK6+k0b4/hydcvjW9JIukp+ vbbh4j6QKDZp1RhhGMjdHM5l5/Lau0ZdxQ7B0zKT+tjptc5Q4Vh/kG2RUmUzdazbkXZb 6QSJwR5kgLTlseenKpEcJy+NXKl1aEyCrqxDl9GHX7aTJNu81IR0/PL8/ovqgITNP5lw Y1dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZjKqVt3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n10si10078115ejj.375.2020.06.08.18.07.16; Mon, 08 Jun 2020 18:07:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZjKqVt3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731026AbgFIBFR (ORCPT + 99 others); Mon, 8 Jun 2020 21:05:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727843AbgFHXHS (ORCPT ); Mon, 8 Jun 2020 19:07:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C833220897; Mon, 8 Jun 2020 23:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657638; bh=5Ku1WPXj1uoC+3mWt0Zai9p6vknK3/wtHVVZgtl6akY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZjKqVt3QAuH6HFxBh1A1wLsSxcyA8sc9uFXuYuQyZwTn7jetmWcdmxdHcoXtzgilX ZDH7/hx/DOuNf9TYmUSzjsPtXmVcFXziTKy18wvKM2EOSItGcurviivcVB+nDIetRT dVuStyQ9OG7rqdfBdUeoJGez3Q/qDWnOcv2lBBGU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Douglas Anderson , Daniel Thompson , Sasha Levin , kgdb-bugreport@lists.sourceforge.net Subject: [PATCH AUTOSEL 5.7 056/274] kgdb: Prevent infinite recursive entries to the debugger Date: Mon, 8 Jun 2020 19:02:29 -0400 Message-Id: <20200608230607.3361041-56-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas Anderson [ Upstream commit 3ca676e4ca60d1834bb77535dafe24169cadacef ] If we detect that we recursively entered the debugger we should hack our I/O ops to NULL so that the panic() in the next line won't actually cause another recursion into the debugger. The first line of kgdb_panic() will check this and return. Signed-off-by: Douglas Anderson Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20200507130644.v4.6.I89de39f68736c9de610e6f241e68d8dbc44bc266@changeid Signed-off-by: Daniel Thompson Signed-off-by: Sasha Levin --- kernel/debug/debug_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 950dc667c823..d47c7d6656cd 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -532,6 +532,7 @@ static int kgdb_reenter_check(struct kgdb_state *ks) if (exception_level > 1) { dump_stack(); + kgdb_io_module_registered = false; panic("Recursive entry to debugger"); } -- 2.25.1