Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331106
| From | Will Deacon <will.deacon@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump |
| Date | 2016-02-10 13:20 +0100 |
| Message-ID | <r0BUt-25C-5@gated-at.bofh.it> (permalink) |
| References | <r0oky-1ql-1@gated-at.bofh.it> <r0Ac3-VA-23@gated-at.bofh.it> <r0BB7-1J1-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Feb 10, 2016 at 11:52:31AM +0000, James Morse wrote: > On 10/02/16 10:29, Will Deacon wrote: > > On Tue, Feb 09, 2016 at 01:26:22PM -0800, Yang Shi wrote: > >> dump_backtrace may be called in kthread context, which is not bound to a single > >> cpu, i.e. khungtaskd, then calling smp_processor_id may trigger the below bug > >> report: > > > > If we're preemptible here, it means that our irq_stack_ptr is potentially > > bogus. Whilst this isn't an issue for kthreads, it does feel like we > > could make this slightly more robust in the face of potential frame > > corruption. Maybe just zero the IRQ stack pointer if we're in preemptible > > context? > > Switching between stacks is only valid if we are tracing ourselves while on the > irq_stack, we should probably prevent it for other tasks too. > > Something like (untested): > --------------------- > if (tsk == current && in_atomic()) > irq_stack_ptr = IRQ_STACK_PTR(smp_processor_id()); > else > irq_stack_ptr = 0; > --------------------- > > This would work when we trace ourselves while on the irq_stack, but break* > tracing a running task on a remote cpu (khungtaskd doesn't do this). > > The same fix would apply to unwind_frame(), we have 'tsk' in both functions. > > Thoughts? in_atomic is a misnomer: https://lwn.net/Articles/274695/ ;) So we might be better off zeroing the pointer if tsk != current || preemptible(). But yeah, I think we're in general agreement about this. Will
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] arm64: use raw_smp_processor_id in stack backtrace dump Yang Shi <yang.shi@linaro.org> - 2016-02-09 22:50 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump Will Deacon <will.deacon@arm.com> - 2016-02-10 11:30 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump James Morse <james.morse@arm.com> - 2016-02-10 13:00 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump Will Deacon <will.deacon@arm.com> - 2016-02-10 13:20 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump "Shi, Yang" <yang.shi@linaro.org> - 2016-02-10 19:20 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump James Morse <james.morse@arm.com> - 2016-02-11 11:50 +0100
Re: [PATCH] arm64: use raw_smp_processor_id in stack backtrace dump "Shi, Yang" <yang.shi@linaro.org> - 2016-02-11 18:40 +0100
csiph-web