From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AF01320A5EE; Thu, 12 Dec 2024 17:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734025068; cv=none; b=DHDpHmEBXJeTYSznxm1xhFRtuo6B67HZFcdmzoHwAydSK8LtYf//yqLS+/dx3dZESBzZOIyHbTsb0T9G+1MAsvo9ynO7paIxFsJc+Kns434cc7+r/gOWRUzrAekFGfAKkS50/2oZJQ8g746m+GWOQwRH5AurbEeWHaKTIpKc5Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734025068; c=relaxed/simple; bh=woMTMZVZTWjWqsBKbKQMMoiSLUZsghH6iBCvoy99U08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mdflJ3CNVMIjiBvgzvtvk6y0zXkOdJmu3ZAs+VCifadED+psiA1chmRH19aQkLs0JVK4dGN8xfCqUCXDrI94m9rHtAB1350dC0XkTbN3NZjFZmuWMEBpuFOhFH+zzFpTakQzhZ/vA+A++ILgtK96dlIUzpWGFazbVnqE0Fpaj40= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XqLIPplY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XqLIPplY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 350BBC4CECE; Thu, 12 Dec 2024 17:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734025068; bh=woMTMZVZTWjWqsBKbKQMMoiSLUZsghH6iBCvoy99U08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqLIPplY5sbVkGjlIs5/1ZyP9OQeCi6ES+6cLFcRc4HJQgkSP4Gz/B5NefoTss6hP wITHfviDq/+eE9zlGw9TwJyKFb/wtZO3UkTltxCe3HhPJr1AZh+DU77kvodwEsoOHb 5HVq5AlXp03PHFiQDoZoWddEWMel/dxx7mgmrGpM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li Zhijian , Shuah Khan , Sasha Levin Subject: [PATCH 5.4 015/321] selftests/watchdog-test: Fix system accidentally reset after watchdog-test Date: Thu, 12 Dec 2024 15:58:53 +0100 Message-ID: <20241212144230.249734773@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144229.291682835@linuxfoundation.org> References: <20241212144229.291682835@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Zhijian [ Upstream commit dc1308bee1ed03b4d698d77c8bd670d399dcd04d ] When running watchdog-test with 'make run_tests', the watchdog-test will be terminated by a timeout signal(SIGTERM) due to the test timemout. And then, a system reboot would happen due to watchdog not stop. see the dmesg as below: ``` [ 1367.185172] watchdog: watchdog0: watchdog did not stop! ``` Fix it by registering more signals(including SIGTERM) in watchdog-test, where its signal handler will stop the watchdog. After that # timeout 1 ./watchdog-test Watchdog Ticking Away! . Stopping watchdog ticks... Link: https://lore.kernel.org/all/20241029031324.482800-1-lizhijian@fujitsu.com/ Signed-off-by: Li Zhijian Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/watchdog/watchdog-test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c index f45e510500c0d..09773695d219f 100644 --- a/tools/testing/selftests/watchdog/watchdog-test.c +++ b/tools/testing/selftests/watchdog/watchdog-test.c @@ -242,7 +242,13 @@ int main(int argc, char *argv[]) printf("Watchdog Ticking Away!\n"); + /* + * Register the signals + */ signal(SIGINT, term); + signal(SIGTERM, term); + signal(SIGKILL, term); + signal(SIGQUIT, term); while (1) { keep_alive(); -- 2.43.0