This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] x86 - Enhance DEBUG_RODATA support - alternatives
- From: Ingo Molnar <mingo at elte dot hu>
- To: pageexec at freemail dot hu
- Cc: Mathieu Desnoyers <mathieu dot desnoyers at polymtl dot ca>, Srinivasa DS <srinivasa at in dot ibm dot com>, Andrew Morton <akpm at linux-foundation dot org>, linux-kernel at vger dot kernel dot org, ananth at in dot ibm dot com, Jim Keniston <jkenisto at us dot ibm dot com>, srikar at linux dot vnet dot ibm dot com, SystemTAP <systemtap at sources dot redhat dot com>, Andi Kleen <andi at firstfloor dot org>, Thomas Gleixner <tglx at linutronix dot de>, Ingo Molnar <mingo at redhat dot com>, "H. Peter Anvin" <hpa at zytor dot com>, Jeremy Fitzhardinge <jeremy at goop dot org>, Arjan van de Ven <arjan at infradead dot org>
- Date: Thu, 6 Mar 2008 16:52:38 +0100
- Subject: Re: [PATCH] x86 - Enhance DEBUG_RODATA support - alternatives
- References: <20080306140105.GC28438@elte.hu> <47D014E1.30964.22A9390F@pageexec.freemail.hu>
* pageexec@freemail.hu <pageexec@freemail.hu> wrote:
> > + vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL);
> > + WARN_ON(!vaddr);
> > + local_irq_save(flags);
> > + memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len);
> > + local_irq_restore(flags);
>
> you probably want a BUG_ON instead (or some graceful recovery) else
> the NULL deref will trigger with IRQs off...
agreed - i changed it to BUG_ON() for the time being.
Ingo