Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-25 Thread Doug Anderson
Hi, On Mon, Aug 24, 2015 at 4:56 PM, Doug Anderson wrote: >> Perhaps we need to test if we're already atomic in patch_text, and >> only call stop_machine if we need to? >> >> Untested (and likely mangled by gmail): >> >> diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c >> index

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-25 Thread Doug Anderson
Hi, On Mon, Aug 24, 2015 at 4:56 PM, Doug Anderson diand...@chromium.org wrote: Perhaps we need to test if we're already atomic in patch_text, and only call stop_machine if we need to? Untested (and likely mangled by gmail): diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Kees Cook
On Mon, Aug 24, 2015 at 4:56 PM, Doug Anderson wrote: > Kees, > > On Mon, Aug 24, 2015 at 10:46 AM, Kees Cook wrote: >> On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson wrote: >>> On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo wrote: Hi, The breakpoint setting code in

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Doug Anderson
Kees, On Mon, Aug 24, 2015 at 10:46 AM, Kees Cook wrote: > On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson wrote: >> On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo wrote: >>> Hi, >>> >>> The breakpoint setting code in arch/arm/kernel/kgdb.c calls >>> patch_text(), which ends up trying to sleep

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Kees Cook
On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson wrote: > On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo wrote: >> Hi, >> >> The breakpoint setting code in arch/arm/kernel/kgdb.c calls >> patch_text(), which ends up trying to sleep while in interrupt context. >> The bug was introduced by commit:

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Kees Cook
On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson diand...@chromium.org wrote: On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo avien...@nvidia.com wrote: Hi, The breakpoint setting code in arch/arm/kernel/kgdb.c calls patch_text(), which ends up trying to sleep while in interrupt context. The bug

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Doug Anderson
Kees, On Mon, Aug 24, 2015 at 10:46 AM, Kees Cook keesc...@chromium.org wrote: On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson diand...@chromium.org wrote: On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo avien...@nvidia.com wrote: Hi, The breakpoint setting code in arch/arm/kernel/kgdb.c calls

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-24 Thread Kees Cook
On Mon, Aug 24, 2015 at 4:56 PM, Doug Anderson diand...@chromium.org wrote: Kees, On Mon, Aug 24, 2015 at 10:46 AM, Kees Cook keesc...@chromium.org wrote: On Sun, Aug 23, 2015 at 7:45 PM, Doug Anderson diand...@chromium.org wrote: On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-23 Thread Doug Anderson
Aapo, Including the stack trace with this would have been helpful, though it's not too hard to reproduce. Here it is: [ 416.510559] BUG: scheduling while atomic: swapper/0/0/0x00010007 [ 416.516554] Modules linked in: [ 416.519614] CPU: 0 PID: 0 Comm: swapper/0 Not tainted

Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-23 Thread Doug Anderson
Aapo, Including the stack trace with this would have been helpful, though it's not too hard to reproduce. Here it is: [ 416.510559] BUG: scheduling while atomic: swapper/0/0/0x00010007 [ 416.516554] Modules linked in: [ 416.519614] CPU: 0 PID: 0 Comm: swapper/0 Not tainted

[BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-05 Thread Aapo Vienamo
Hi, The breakpoint setting code in arch/arm/kernel/kgdb.c calls patch_text(), which ends up trying to sleep while in interrupt context. The bug was introduced by commit: 23a4e40 arm: kgdb: Handle read-only text / modules. The resulting behavior is "BUG: scheduling while atomic..." when setting a

[BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-05 Thread Aapo Vienamo
Hi, The breakpoint setting code in arch/arm/kernel/kgdb.c calls patch_text(), which ends up trying to sleep while in interrupt context. The bug was introduced by commit: 23a4e40 arm: kgdb: Handle read-only text / modules. The resulting behavior is BUG: scheduling while atomic... when setting a