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: <87370v9mkg.fsf@notabene.neil.brown.name>
Date:   Tue, 20 Mar 2018 19:29:51 +1100
From:   NeilBrown <neil@...wn.name>
To:     John Crispin <john@...ozen.org>,
        Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>
Cc:     linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: [PATCH] MIPS: ralink: remove ralink_halt()


ralink_halt() does nothing that machine_halt()
doesn't already do, so it adds no value.

It actually causes incorrect behaviour due to the
"unreachable()" at the end.  This tell the compiler that the
end of the function will never be reached, which isn't true.
The compiler responds by not adding a 'return' instruction,
so control simply moves on to whatever bytes come afterwards
in memory.  In my tested, that was the ralink_restart()
function.  This means that an attempt to 'halt' the machine
would actually cause a reboot.

So remove ralink_halt() so that a 'halt' really does halt.

Signed-off-by: NeilBrown <neil@...wn.name>
---
 arch/mips/ralink/reset.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/mips/ralink/reset.c b/arch/mips/ralink/reset.c
index 64543d66e76b..e9531fea23a2 100644
--- a/arch/mips/ralink/reset.c
+++ b/arch/mips/ralink/reset.c
@@ -96,16 +96,9 @@ static void ralink_restart(char *command)
 	unreachable();
 }
 
-static void ralink_halt(void)
-{
-	local_irq_disable();
-	unreachable();
-}
-
 static int __init mips_reboot_setup(void)
 {
 	_machine_restart = ralink_restart;
-	_machine_halt = ralink_halt;
 
 	return 0;
 }
-- 
2.14.0.rc0.dirty


Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ