Re: [PATCH] x86 - Enhance DEBUG_RODATA support - alternatives

From: Ingo Molnar
Date: Thu Mar 06 2008 - 10:54:22 EST



* pageexec@xxxxxxxxxxx <pageexec@xxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/