Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3311635rdb; Tue, 6 Feb 2024 13:44:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeooOt8vu3Mso2mIDmKh9OoLgXUyKCTdfIT3LD3kw4P7BwlrSbQhGpPyIy/fLHZQ+qPh5G X-Received: by 2002:a5d:4986:0:b0:33b:20c:d2cc with SMTP id r6-20020a5d4986000000b0033b020cd2ccmr2205438wrq.20.1707255869239; Tue, 06 Feb 2024 13:44:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707255869; cv=pass; d=google.com; s=arc-20160816; b=aW1FFMspDmsXFqwjZqOfQsdDgUQvogJPGSnra30sWjEWQT3X1MkqTvCBRj0JIlR61R MJM4FaIpkUonfhT65Rq1oi2lvNbLZmNQ/nrfzET8WEgWjLbxVMMMv8g2/UgjMs+JSaIg WyL73vgD7WeDqyh68QhHAWBKAZO8mTB39wdPsV7FnKp2UYnHGWhCG4JgUAHz8RnR4201 QpMfoQhZheteDRBAVCKyTWB/Q3Scw4fzbL7nCsgES5/YsUX/5MxqbW36LfWjqSMrnoTf ycgzWsTRwAke8hm2G0htplmOHIs5uO9LdVLqNLG3oFSPHsZFl2yczx+aOQMs7Y/mZmbp zGvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:to:from:date:dkim-signature; bh=nQ5xe0HKKbq/ErxUGJNXKaGM7XjTWDe6iVd0oA3K8jU=; fh=poGjfl3uxTdVT2eIx7iSiAlSNOPEfv1J1MndwZ5uQi4=; b=FMtyCPKTgJAOZMuN2tWz8kAIOVyCDmu2Lx3cK2JSFlIyjJJ1aBQnkqI5yPY7/aCaxI OncLHwzK82rEw1/LRe8TjgcYCUFOuXh8mn3AqhWQ31+SupqK/8Dr5u1EHRisqffTW+oi 25f7ZQZ06zWH6Ldr3siDsovJ6uXOLeupmrvrTGWkO+BPgEI20SdkGfoZqXFdm84KgrT3 puPXIZownh3F0y3GgeZM/VFytLONg1ZyvRLw7BVj7Yn7mS8LIy+YFR6p1qm6vu/0+7Jy cVCYCgBW0/C9q+gJ3YtXYZAOlrcS5XvMGGoxIoqXIqUr/trBLKtVU8OWwXTWZwBcJtYh qdDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lichtman.org header.s=mail header.b=MslBc6fW; arc=pass (i=1 spf=pass spfdomain=lichtman.org dkim=pass dkdomain=lichtman.org dmarc=pass fromdomain=lichtman.org); spf=pass (google.com: domain of linux-kernel+bounces-55645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lichtman.org X-Forwarded-Encrypted: i=1; AJvYcCWOoQ0uQ3ARtoNhmcG1zEA41Nb+9OPpAjvSvEeAir5vIQd1EJ4SlyEPikHAD/KQleYrLFe9w6hemKFhvu7yOQFRo4C/xPPpgd4LV8abow== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dh16-20020a0564021d3000b00560765a3d06si1566199edb.51.2024.02.06.13.44.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 13:44:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lichtman.org header.s=mail header.b=MslBc6fW; arc=pass (i=1 spf=pass spfdomain=lichtman.org dkim=pass dkdomain=lichtman.org dmarc=pass fromdomain=lichtman.org); spf=pass (google.com: domain of linux-kernel+bounces-55645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lichtman.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F41E01F22497 for ; Tue, 6 Feb 2024 21:44:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 552801BDD9; Tue, 6 Feb 2024 21:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lichtman.org header.i=@lichtman.org header.b="MslBc6fW" Received: from lichtman.org (lichtman.org [149.28.33.109]) (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 C2CED1BC35 for ; Tue, 6 Feb 2024 21:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.33.109 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707255861; cv=none; b=QlgysGq+5pa1nPEXTg3JhEGZfBNPSMnQN2dRDOWjQ6UmEcOCLZ03zQ4wXLOjQQ3j0yd02ZA9IHlGejDmNMWWZZXfiFfh2ty6dHQDCA4GWhbN0BGT5gFUnMybnzXfrkRlgeJxEhP+Jw7AEGb4WQwlCz8+pxHamRmZMSx5n7BEXUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707255861; c=relaxed/simple; bh=lH5sVaiLtqfzbtaHk3feLejvLIsj4MXSS+5uIQz64KA=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Pc4RbXc1g3frNa2Hw3tCpxQBpWg/m4lBEtXLKnMJkDUExaPaHEhnAp5ygt8ZqlDaQ7VhWZiXIu0Tr3UX7z4JxkvqelF8TkgwgmPele6gMUx0GjuF11f05RGxUYXeSHj7qKGpEU2HkNJolgCqEiXwnDArwmwUtZq5/ROtF9u4AfQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lichtman.org; spf=pass smtp.mailfrom=lichtman.org; dkim=pass (2048-bit key) header.d=lichtman.org header.i=@lichtman.org header.b=MslBc6fW; arc=none smtp.client-ip=149.28.33.109 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lichtman.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lichtman.org Received: by lichtman.org (Postfix, from userid 1000) id CEC31176E0F; Tue, 6 Feb 2024 21:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lichtman.org; s=mail; t=1707255542; bh=lH5sVaiLtqfzbtaHk3feLejvLIsj4MXSS+5uIQz64KA=; h=Date:From:To:Subject:From; b=MslBc6fWC1O/HL7WEIkwStU/meOS2aJg/sQ6wGFsrMUfntp/gxPKLMg099WZbT5tE uvtLgQ3gOeV5lnIgeLBze/RzYQTbhvN31VGeLF8Go4kmmV8HkWBIKGK5ulkWJgf95B izBdpYtkVU9ozPzbgaRTpd0MkOJgi011mTUsviZm0khmasvJm/Dq/kybSl/FMU0ItV EkxC2TbxL5a4kNnj04ZT/IbakBdu3uzdNu7U0VCY7YU1rcUOC9KA1ISQrTHPXZHEu2 TSvcjVF+OPH/HU3T58YNTcU/9Y8eqmm4TNGFhSs/g6zmvqnwTjys+g2LdqeYlmtzsa zaD8d5OxKmqdg== Date: Tue, 6 Feb 2024 21:39:02 +0000 From: Nir Lichtman To: linux-kernel@vger.kernel.org Subject: [PATCH] kernel: add boot param to disable stack dump on panic Message-ID: <20240206213902.GA1490631@lichtman.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline From: Nir Lichtman Date: Sat, 3 Feb 2024 10:19:30 +0200 Subject: [PATCH] kernel: add boot param to disable stack dump on panic --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ kernel/panic.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 31b3a2568..433e3e5d1 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1127,6 +1127,11 @@ MTRR settings. This parameter disables that behavior, possibly causing your machine to run very slowly. + disable_stack_dump_on_panic + This parameter disables call stack dumping when there + is a panic, which can help obscure less earlier messages + that lead to the panic. + disable_timer_pin_1 [X86] Disable PIN 1 of APIC timer Can be useful to work around chipset bugs. diff --git a/kernel/panic.c b/kernel/panic.c index 2807639aa..a1e1d064e 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -266,6 +266,16 @@ static void panic_other_cpus_shutdown(bool crash_kexec) crash_smp_send_stop(); } +static int disable_stack_dump_on_panic __initdata; + +static int __init disable_stack_dump_on_panic_setup(char *str) +{ + disable_stack_dump_on_panic = 1; + return 0; +} + +early_param("disable_stack_dump_on_panic", disable_stack_dump_on_panic_setup); + /** * panic - halt the system * @fmt: The text string to print @@ -340,7 +350,7 @@ void panic(const char *fmt, ...) /* * Avoid nested stack-dumping if a panic occurs during oops processing */ - if (!test_taint(TAINT_DIE) && oops_in_progress <= 1) + if (!test_taint(TAINT_DIE) && oops_in_progress <= 1 && !disable_stack_dump_on_panic) dump_stack(); #endif -- 2.39.2