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>] [day] [month] [year] [list]
Message-Id: <1253029947-670-1-git-send-email-louis.rilling@kerlabs.com>
Date:	Tue, 15 Sep 2009 17:52:27 +0200
From:	Louis Rilling <louis.rilling@...labs.com>
To:	Jason Wessel <jason.wessel@...driver.com>
Cc:	kgdb-bugreport@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	Louis Rilling <louis.rilling@...labs.com>
Subject: [PATCH] Let gdb assume that kgdb supports extended mode

Hi,

When looking for ways to reboot my target machine from gdb, I had to implement
the patch below.

Then, from gdb, one has to attach as extended-remote target, and the
'run' command will reboot the target machine.

The behavior is not perfect since gdb will complain afterwards, and the user
has to interrupt it and detach to recover usage. But AFAICS, gdb's remote
protocol only uses the 'RXX' remote command in extended mode, which makes the
current implementation of the 'R0' command in kgdb unreachable from gdb.

So, are there reasons not to include such a patch?

Thanks,

Louis

-------------------------------------------------->
Subject: [PATCH] Let gdb assume that kgdb supports extended mode

... and allow users to reboot the target machine from gdb.

Signed-off-by: Louis Rilling <louis.rilling@...labs.com>
---
 kernel/kgdb.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 5f15d33..e39f886 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -829,6 +829,12 @@ static int kgdb_io_ready(int print_wait)
  * where KGDB is communicating with an external debugger
  */
 
+/* Handle the '!' extended mode request */
+static void gdb_cmd_extended(struct kgdb_state *ks)
+{
+	strcpy(remcom_out_buffer, "OK");
+}
+
 /* Handle the '?' status packets */
 static void gdb_cmd_status(struct kgdb_state *ks)
 {
@@ -1252,6 +1258,9 @@ static int gdb_serial_stub(struct kgdb_state *ks)
 		get_packet(remcom_in_buffer);
 
 		switch (remcom_in_buffer[0]) {
+		case '!': /* extended mode */
+			gdb_cmd_extended(ks);
+			break;
 		case '?': /* gdbserial status */
 			gdb_cmd_status(ks);
 			break;
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ