We're about to add more options for command behaviour, so let's expand
the meaning of kdb_repeat_t.
So far we just do various renames, there should be no functional changes.
Signed-off-by: Anton Vorontsov
---
include/linux/kdb.h|4 ++--
kernel/debug/kdb/kdb_main.c|6 +++-
> The following commands were marked as "safe":
>
> Clear Breakpoint
> Enable Breakpoint
> Disable Breakpoint
> Display exception frame
> Stack traceback
This is sufficient to steal cryptographic keys in many environments. In
fact you merely need two or three breakpo
It's all pretty straightforward, except for TXIM interrupt. The interrupt
has meaning "ready to transmit", so it's almost always raised, and the
only way to silence it is to mask it. But that's OK, ops->start_tx will
unmask it.
Signed-off-by: Anton Vorontsov
---
drivers/tty/serial/amba-pl011.c |
By issuing 'echo 1 > /sys/module/kdb/parameters/kiosk' or
booting with kdb.kiosk=1 kernel command line option, one can still have
a somewhat usable debugging facility, but not fearing that the
debugger can be used to easily gain root access or dump sensitive data.
Without the kiosk mode, obtaining
This patch introduces two new flags: KDB_SAFE, denotes a safe command,
and KDB_SAFE_NO_ARGS, denotes a safe command when used without arguments.
The word "safe" here used in the sense that the commands cannot be
used to leak sensitive data from the memory, and cannot be used
to change program flow
This patch implements a new callback: clear_irqs. It is used for the
cases when KDB-entry (e.g. NMI) and KDB IO (e.g. serial port) shares
the same interrupt. To get the idea, let's take some real example (ARM
machine): we have a serial port which interrupt is routed to an NMI,
and the interrupt is
On Fri, Jul 27, 2012 at 12:30:49PM -0700, Colin Cross wrote:
> > The are two use-cases for the mode, one is evil, but another is quite
> > legitimate.
> >
> > The evil use case is used by some (ahem) phone manufaturers that want
> > to have a debuging facilities on a production device, but still do
Just move the macros into header file as we would want to use them for
KGDB FIQ entry code.
The following macros were moved:
- svc_entry
- usr_entry
- kuser_cmpxchg_check
- vector_stub
To make kuser_cmpxchg_check actually work across different files, we
also have to make kuser_cmpxchg64_fixu
On Mon, Jul 30, 2012 at 4:58 AM, Anton Vorontsov
wrote:
> This command disables NMI-entry. If NMI source was previously shared with
> a serial console ("debug port"), this effectively releases the port from
> KDB exclusive use, and makes the console available for normal use.
>
> Of course, NMI can
This patch introduces two new flags: KDB_SAFE, denotes a safe command,
and KDB_SAFE_NO_ARGS, denotes a safe command when used without arguments.
The word "safe" here used in the sense that the commands cannot be
used to leak sensitive data from the memory, and cannot be used
to change program flow
Hi
I solved the problem by writing a small patch for the 8250 driver
(solves the issue for me).
However, I noticed that kdb has no disassembly support now, so it is
pretty useless - you cannot use a debugger without examining the code!
(a C debugger must show you C code, asm debugger must show yo
This command disables NMI-entry. If NMI source was previously shared with
a serial console ("debug port"), this effectively releases the port from
KDB exclusive use, and makes the console available for normal use.
Of course, NMI can be reenabled, enable_nmi modparam is used for that:
echo
The actual values of KDB_REPEAT_* enum values and overall logic stayed
the same, but we now treat the values as flags.
This makes it possible to add other flags and combine them, plus makes
the code a lot simpler and shorter. But functionality-wise, there should
be no changes.
Signed-off-by: Anto
On Tue, 2012-07-17 at 10:09 -0500, Stefan Parlitz wrote:
> On Tue, 2012-07-17 at 09:41 -0500, Jason Wessel wrote:
> > On 07/16/2012 05:12 PM, Stefan Parlitz wrote:
> >
> > > Hi
> > >
> > > I'm trying to use KDB with minicom, connected to serial port of a
> > > VM.
> > > Pressing ctrl-a f g does n
We're about to add more options for commands behaviour, so let's give
a more generic name to the low-level kdb command registration function.
There are just various renames, no functional changes.
Signed-off-by: Anton Vorontsov
---
include/linux/kdb.h |6 +--
kernel/debug/kdb/kdb_bp
As Colin Cross noticed, serial ports could be noisy, so occasional
characters once in a while are possible. So, considering the noise
possibility, entering the debugger on any received byte is unacceptable
for production devices.
This changes KGDB FIQ behaviour in a such way so that we have to typ
On Mon, Jul 30, 2012 at 04:58:16AM -0700, Anton Vorontsov wrote:
> + .align 5
> +__fiq_svc:
> + svc_entry
> + fiq_handler
> + svc_exit r5 @ return from exception
> + UNWIND(.fnend )
> +ENDPROC(__fiq_svc)
> + .ltorg
> +
> + .align 5
On Mon, Jul 30, 2012 at 04:58:20AM -0700, Anton Vorontsov wrote:
> This makes the code more izolated.
>
> The downside of this is that we now have an additional branch and the
> code itself is 8 bytes longer. But on the bright side, this new layout
> can be more cache friendly since cr_alignment a
Just a couple of calls to manage VIC FIQ routing. We'll use them for
KGDB FIQ support on ARM Versatile machines.
Signed-off-by: Anton Vorontsov
---
arch/arm/common/vic.c | 28
arch/arm/include/asm/hardware/vic.h |2 ++
2 files changed, 30 insertio
On Thu, Jul 26, 2012 at 7:25 AM, Anton Vorontsov
wrote:
> Hi all,
>
> Here is a patchset that implements "kiosk" mode for KDB debugger. The
> mode provides reduced set of features, so that it is no longer possible
> to leak sensitive data via the debugger, and not possible to change
> program flow
On 07/30/2012 06:58 AM, Anton Vorontsov wrote:
> Currently kernel never set KGDB_REASON_NMI. We do now, when we enter
> KGDB/KDB from an NMI.
>
> This is not to be confused with kgdb_nmicallback(), NMI callback is
> an entry for the slave CPUs during CPUs roundup, but REASON_NMI is the
> entry for
Hi there,
I need to debug an android phone with which using serial port is
not convenient.
So I consider writing a virtual tty driver which implements two
connected virtual tty devices. kgdboc would be connected to tty1, tty2
would be forwarded to the PC through 'adb forward', then I c
If enabled, kernel will able to enter KGDB upon serial line activity on
UART ports.
Note that even with this patch and CONFIG_KGDB_FIQ is enabled, you still
need to pass kgdb_fiq.enable=1 kernel command line option, otherwise UART
will behave in a normal way.
By default UART0 is used, but this ca
On Fri, Jul 27, 2012 at 6:26 PM, Anton Vorontsov wrote:
> But if you say that it wasn't the case, and no one thought about the
> reducing the debugger in the "evil" way, so be it, I trust you. But I
> still don't trust the phone vendors. They showed their bad attitude
> in many ways towards hack
Currently kernel never set KGDB_REASON_NMI. We do now, when we enter
KGDB/KDB from an NMI.
This is not to be confused with kgdb_nmicallback(), NMI callback is
an entry for the slave CPUs during CPUs roundup, but REASON_NMI is the
entry for the master CPU.
Signed-off-by: Anton Vorontsov
---
kern
The FIQ debugger may be used to debug situations when the kernel stuck
in uninterruptable sections, e.g. the kernel infinitely loops or
deadlocked in an interrupt or with interrupts disabled.
By default KGDB FIQ is disabled in runtime, but can be enabled with
kgdb_fiq.enable=1 kernel command line
On Tue, 2012-07-17 at 09:41 -0500, Jason Wessel wrote:
> On 07/16/2012 05:12 PM, Stefan Parlitz wrote:
>
> > Hi
> >
> > I'm trying to use KDB with minicom, connected to serial port of a
> > VM.
> > Pressing ctrl-a f g does not activate KDB (it is correctly compiled
> > etc), instead only "g" appe
Hi all,
Here is a patchset that implements "kiosk" mode for KDB debugger. The
mode provides reduced set of features, so that it is no longer possible
to leak sensitive data via the debugger, and not possible to change
program flow in a predefined manner.
The are two use-cases for the mode, one is
On Mon, Jul 30, 2012 at 04:58:19AM -0700, Anton Vorontsov wrote:
> diff --git a/arch/arm/mach-versatile/include/mach/irqs.h
> b/arch/arm/mach-versatile/include/mach/irqs.h
> index bf44c61..fcd2a95 100644
> --- a/arch/arm/mach-versatile/include/mach/irqs.h
> +++ b/arch/arm/mach-versatile/include/ma
On Fri, Jul 13, 2012 at 2:49 AM, Anton Vorontsov
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
The new arch callback should manage NMIs that usually cause KGDB to
enter. That is, not all NMIs should be enabled/disabled, but only
those that issue kgdb_handle_exception().
We must mask it as serial-line interrupt can be used as an NMI, so
if the original KGDB-entry cause was say a breakpoint,
On 07/27/2012 06:26 PM, Anton Vorontsov wrote:
> On Fri, Jul 27, 2012 at 12:30:49PM -0700, Colin Cross wrote:
>>> The are two use-cases for the mode, one is evil, but another is quite
>>> legitimate.
>>>
>>> The evil use case is used by some (ahem) phone manufaturers that want
>>> to have a debugin
The struct member is never used in the code, so we can remove it.
We will introduce real flags soon by renaming cmd_repeat to cmd_flags.
Signed-off-by: Anton Vorontsov
---
kernel/debug/kdb/kdb_main.c|1 -
kernel/debug/kdb/kdb_private.h |1 -
2 files changed, 2 deletions(-)
diff --g
This makes the code more izolated.
The downside of this is that we now have an additional branch and the
code itself is 8 bytes longer. But on the bright side, this new layout
can be more cache friendly since cr_alignment address might be already
in the cache line (not that I measured anything, it
Hi all,
I do realize that we're in the middle of the merge window. But maybe
some of you will be bored enough to look into this; and no problem if
you don't feel like it -- I promise to send a brand new shiny v4 after
the merge window, so you won't miss a bit of this new cool stuff. :-)
In v3:
-
On Thu, Jul 26, 2012 at 06:07:09PM +0100, Alan Cox wrote:
> > The following commands were marked as "safe":
> >
> > Clear Breakpoint
> > Enable Breakpoint
> > Disable Breakpoint
> > Display exception frame
> > Stack traceback
>
> This is sufficient to steal cryptographic keys
Since we now treat KDB_REPEAT_* as flags, there is no need to
pass KDB_REPEAT_NONE. It's just the default behaviour when no
flags are specified.
Signed-off-by: Anton Vorontsov
---
include/linux/kdb.h |1 -
kernel/debug/kdb/kdb_bp.c |6 ++---
kernel/debug/kdb/kdb_main.c | 59 +
On Fri, Jul 13, 2012 at 09:43:45AM -0700, Colin Cross wrote:
[...]
> I was referring to the security implications, not size. Leaving KDB
> on is effectively instant root access over the serial console.
Oh, I see. Yes, for this we'd need to disable all modification commands.
[...]
> > The thing i
38 matches
Mail list logo