Re: [PATCH 1/3] kcov: ensure irq code sees a valid area

2018-05-04 Thread Mark Rutland
On Fri, May 04, 2018 at 02:55:33PM +0100, Mark Rutland wrote: > In kcov_init_task() Since we update t->kcov_{mode,area,size} with plain > stores, which may be re-ordered, torn, etc. Thus > __sanitizer_cov_trace_pc() may see bogus values for any of these fields, > and may attempt to write to memory

Re: [PATCH 1/3] kcov: ensure irq code sees a valid area

2018-05-04 Thread Mark Rutland
On Fri, May 04, 2018 at 02:55:33PM +0100, Mark Rutland wrote: > In kcov_init_task() Since we update t->kcov_{mode,area,size} with plain > stores, which may be re-ordered, torn, etc. Thus > __sanitizer_cov_trace_pc() may see bogus values for any of these fields, > and may attempt to write to memory

[PATCH 1/3] kcov: ensure irq code sees a valid area

2018-05-04 Thread Mark Rutland
For kernels built with CONFIG_PREEMPT, some C code may execute before or after the interrupt handler, while the hardirq count is zero. In these cases, in_task() can return true. A task can be interrupted in the middle of a KCOV_DISABLE ioctl while it resets the task's kcov data via

[PATCH 1/3] kcov: ensure irq code sees a valid area

2018-05-04 Thread Mark Rutland
For kernels built with CONFIG_PREEMPT, some C code may execute before or after the interrupt handler, while the hardirq count is zero. In these cases, in_task() can return true. A task can be interrupted in the middle of a KCOV_DISABLE ioctl while it resets the task's kcov data via