lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241204084028.6067-1-liujing@cmss.chinamobile.com>
Date: Wed,  4 Dec 2024 16:40:28 +0800
From: liujing <liujing@...s.chinamobile.com>
To: richard.henderson@...aro.org,
	ink@...assic.park.msu.ru,
	mattst88@...il.com,
	paulmck@...nel.org,
	arnd@...db.de
Cc: linux-alpha@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	liujing <liujing@...s.chinamobile.com>
Subject: [PATCH] alpha: Fix condition 'i>40' is always false

The i variable is used to count the number of stack frames printed,
but it is initialized to 0 only at the beginning of the loop, and
is not increased later in the loop. Therefore, the value of i is
always 0, resulting in the condition if (i > 40) never being true.

To ensure that i counts correctly, you need to increase the value
of i each time the stack frame is successfully printed.

Signed-off-by: liujing <liujing@...s.chinamobile.com>

diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index 6afae65e9a8b..65c44756f949 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -100,6 +100,7 @@ dik_show_trace(unsigned long *sp, const char *loglvl)
 		if (!is_kernel_text(tmp))
 			continue;
 		printk("%s[<%lx>] %pSR\n", loglvl, tmp, (void *)tmp);
+		i++;
 		if (i > 40) {
 			printk("%s ...", loglvl);
 			break;
-- 
2.27.0




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ