From: <carrollbryanm@gmail.com>
To: <kernelnewbies@kernelnewbies.org>
Subject: serial debug: permission denied
Date: Sat, 27 Apr 2024 18:19:54 -0500 [thread overview]
Message-ID: <032101da98f9$69798060$3c6c8120$@gmail.com> (raw)
In-Reply-To: <031a01da98f9$0e5b3cf0$2b11b6d0$@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 5170 bytes --]
Hi all,
I'm attempting to use gdb to debug over a serial connection using two VM's.
I'm getting a "Permission denied" when I try to connect over the serial com
port. Gdb has the following output when I try to connect:
Reading symbols from vmlinux...
+target remote /dev/ttyS1
Remote debugging using /dev/ttyS1
[remote] start_remote_1: enter
[remote] Sending packet:
$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-e
vents+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-taggin
g+#ec
[remote] Junk: d
[remote] Junk: i
[remote] Junk: a
[remote] Junk: g
[remote] Junk: :
[remote] Junk:
[remote] Received Nak
[remote] Sending packet:
$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-e
vents+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-taggin
g+#ec
[remote] Junk: 2
[remote] Junk: 2
[remote] Junk: :
[remote] Junk:
[remote] Junk: P
[remote] Junk: e
[remote] Junk: r
[remote] Junk: m
[remote] Junk: i
[remote] Junk: s
[remote] Junk: s
[remote] Junk: i
[remote] Junk: o
[remote] Junk: n
[remote] Junk:
[remote] Junk: d
[remote] Junk: e
[remote] Junk: n
[remote] Junk: i
[remote] Junk: e
[remote] Junk: d
[remote] Junk: ^M
[remote] Junk:
[remote] Junk: [
[remote] Junk: 2
[remote] Junk: ]
[remote] Junk: k
[remote] Junk: d
[remote] Junk: b
[remote] Junk: >
[remote] Junk:
[remote] Junk: :
[remote] Junk: m
[remote] Junk: u
[remote] Junk: l
[remote] Junk: t
[remote] Junk: i
[remote] Junk: p
[remote] Junk: r
[remote] Junk: o
[remote] Junk: c
[remote] Junk: e
[remote] Junk: s
[remote] Junk: s
[remote] Received Ack
[remote] read_frame: Bad checksum, sentsum=0xec, csum=0x8,
buf=qSupporteddiag: -22: Permission denied\r\n[2]kdb>
:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec
-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-tagging+
[remote] getpkt: Timed out.
[remote] getpkt: Timed out.
Ignoring packet error, continuing...
[remote] packet_ok: Packet qSupported (supported-packets) is supported
[remote] Sending packet: $vCont?#49
[remote] Received Nak
[remote] Sending packet: $vCont?#49
[remote] Received Ack
[remote] Packet received: vCont?
[remote] packet_ok: Packet vCont (verbose-resume) is NOT supported
[remote] packet_ok: Packet vCont (verbose-resume) is NOT supported
[remote] Sending packet: $vMustReplyEmpty#3a
[remote] putpkt_binary: Packet instead of Ack, ignoring it
[remote] Received Ack
[remote] Packet received: vMustReplyEmpty
[remote] start_remote_1: exit
Remote replied unexpectedly to 'vMustReplyEmpty': vMustReplyEmpty
+quit
It seems the target is denying permission. I've been searching around but
have not found anything similar. I tried opening the permissions on the
/dev/ttyS1 on both VM's to rwxrwxrwx and that doesn't help. There are no
SELinux warnings on the debugger VM. I don't know if SELinux is causing a
problem on the target VM.
More details about the configuration:
I'm running two Rocky 9.3 VM's on Windows Hyper-V that I have connected over
a named pipe using the Powershell Set-VMComport commands:
Set-VMComport -VMName "Rocky-Debugger" -Number 2 -Path \\.\pipe\rocky-pipe-2
<file://./pipe/rocky-pipe-2>
Set-VMComport -VMName "Rocky " -Number 2 -Path \\.\pipe\rocky-pipe-2
<file://./pipe/rocky-pipe-2>
I downloaded the 6.8.5 kernel from the kernel.org website and compiled it on
the "Rocky" vm using the following configuration:
#
# Generic Kernel Debugging Instruments
#
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_MAGIC_SYSRQ_SERIAL=y
CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_HONOUR_BLOCKLIST=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_KGDB_TESTS=y
# CONFIG_KGDB_TESTS_ON_BOOT is not set
CONFIG_KGDB_LOW_LEVEL_TRAP=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_DEFAULT_ENABLE=0x0
CONFIG_KDB_KEYBOARD=y
CONFIG_KDB_CONTINUE_CATASTROPHIC=0
CONFIG_ARCH_HAS_EARLY_DEBUG=y
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
# CONFIG_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# CONFIG_KCSAN is not set
# end of Generic Kernel Debugging Instruments
I added the kernel args "console=tty0 console=ttyS0,115200
kgdboc=ttyS1,115200". I start the VM with the new kernel and run the command
"echo g > /proc/sysrq-trigger".
On the "Rocky-debugger" vm, I added my user to "dialout". The permissions on
/dev/ttyS1 is rw for the group.
I set the following in .gdbinit, "set serial baud 115200".
Run "gdb vmlinux", then "target remote /dev/ttyS1". That's when I get the
"Permission denied".
I can connect to the console over serial using "sudo screen ttyS0" and that
works just fine. So I don't believe it's a Windows Hyper-V permissions
issue.
I'm out of ideas. Any help is appreciated!
Thanks,
Bryan Carroll
[-- Attachment #1.2: Type: text/html, Size: 11721 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
parent reply other threads:[~2024-04-27 23:22 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <031a01da98f9$0e5b3cf0$2b11b6d0$@gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='032101da98f9$69798060$3c6c8120$@gmail.com' \
--to=carrollbryanm@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).