From: Colin Cross <ccross@android.com>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: "Russell King" <linux@arm.linux.org.uk>,
"Jason Wessel" <jason.wessel@windriver.com>,
"Arve Hjønnevåg" <arve@android.com>,
"John Stultz" <john.stultz@linaro.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-kernel@lists.linaro.org, patches@linaro.org,
kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH 0/6] KGDB/KDB FIQ (NMI) debugger
Date: Fri, 13 Jul 2012 09:43:45 -0700 [thread overview]
Message-ID: <CAMbhsRR6AU2MhX9MO1tV7-Py=sM7jOQdbFP-_WeBhsCL3wGS0A@mail.gmail.com> (raw)
In-Reply-To: <20120713094954.GA12917@lizard>
On Fri, Jul 13, 2012 at 2:49 AM, Anton Vorontsov
<anton.vorontsov@linaro.org> wrote:
> On Thu, Jul 05, 2012 at 05:02:12PM -0700, Colin Cross wrote:
> [...]
>> KGDB can obviously only be enabled on development
>> devices, although perhaps a more limited KDB could be left enabled.
>
> Um, I would argue about 'obviously'. :-) It doesn't require
> CONFIG_DEBUG_INFO (-g) or something like this, so if the concern is
> the size (which is about 30..40 KB), then it is all manageable. If we
> want it to be smaller, we should just work on making KGDB/KDB more
> modular, so that we can exclude non-production features.
I was referring to the security implications, not size. Leaving KDB
on is effectively instant root access over the serial console.
<snip
>> > This might look as a drastic change, but it is not. There is actually
>> > no difference whether you have sync or async shell, or at least I
>> > couldn't find any use-case where this would matter at all. Anyways,
>> > it is still possible to do async shell in KDB, just don't see any
>> > need for this.
>>
>> I think it could be an issue if KDB stopped execution whenever it
>> received any character. Serial ports are often noisy, especially when
>> muxed over another port (we often use serial over the headset
>> connector). Noise on the async command line just causes characters
>> that are ignored, on a command line that blocked execution noise would
>> be catastrophic.
>
> Aha, that's the real use-case, thanks! I started hacking the KDB
> to add the async shell support, but then I realized that we still
> don't need all the complexity. If the only purpose is to be safe from
> the noise, then we can just do "knocking" before entering the debugger.
>
> The thing is, we even have a standard sequence for entering KDB,
> it is GDB-protocol command $3#33, so it actually makes sense to
> implement this. This would be the only async command, and it doesn't
> affect anything but the new code. I prepared a separate patch for this.
I would suggest making the sequence longer than just return. A single
character is not that unlikely to be generated by random noise - I've
seen multiple devices reboot when the serial console was connected
because it received a SysRq-Crash (a break is all zeroes, which is
very common while shorting the lines as the console is plugged in, and
then random noise sent a 'c').
next prev parent reply other threads:[~2012-07-13 16:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 23:10 [PATCH 0/6] KGDB/KDB FIQ (NMI) debugger Anton Vorontsov
2012-07-05 23:12 ` [PATCH 1/6] kernel/debug: Make use of KGDB_REASON_NMI Anton Vorontsov
2012-07-05 23:12 ` [PATCH 2/6] kernel/debug: Mask KGDB NMI upon entry Anton Vorontsov
2012-07-05 23:12 ` [PATCH 3/6] ARM: Move some macros from entry-armv to entry-header Anton Vorontsov
2012-07-05 23:12 ` [PATCH 4/6] ARM: Add KGDB/KDB FIQ debugger generic code Anton Vorontsov
2012-07-05 23:12 ` [PATCH 5/6] ARM: VIC: Add a couple of low-level FIQ management helpers Anton Vorontsov
2012-07-05 23:12 ` [PATCH 6/6] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Anton Vorontsov
2012-07-06 0:02 ` [PATCH 0/6] KGDB/KDB FIQ (NMI) debugger Colin Cross
2012-07-13 9:49 ` Anton Vorontsov
2012-07-13 16:43 ` Colin Cross [this message]
2012-07-13 22:08 ` Anton Vorontsov
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='CAMbhsRR6AU2MhX9MO1tV7-Py=sM7jOQdbFP-_WeBhsCL3wGS0A@mail.gmail.com' \
--to=ccross@android.com \
--cc=anton.vorontsov@linaro.org \
--cc=arve@android.com \
--cc=jason.wessel@windriver.com \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=patches@linaro.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 NNTP newsgroup(s).