Re: [PATCH] i386: actively synchronize vmalloc area when registering certain callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Beulich <[email protected]> writes:

> Registering a callback handler through register_die_notifier() is
> obviously primarily intended for use by modules. However, the way these
> currently get called it is basically impossible for them to actually be
> used by modules, as there is, on non-PAE configurationes, a good chance
> (the larger the module, the better) for the system to crash as a
> result. This is because the callback gets invoked
> (a) in the page fault path before the top level page table propagation
> gets carried out (hence a fault to propagate the top level page table
> entry/entries mapping to module's code/data would nest infinitly) and
> (b) in the NMI path, where nested faults must absolutely not happen,
> since otherwise the IRET from the nested fault re-enables NMIs,
> potentially resulting in nested NMI occurences.
> Besides the modular aspect, similar problems would even arise for in-
> kernel consumers of the API if they touched ioremap()ed or vmalloc()ed
> memory inside their handlers.
> 
> Signed-Off-By: Jan Beulich <[email protected]>

The patch is relatively complicated, but it's such a nasty corner case
(thanks Jan for discovering that one) that could easily hit in kernel
users like kprobes too so I think it's it's good fix it. I did the corresponding
change on x86-64 too.

Actually I tried to simplify it, but failed.

Acked-by: Andi Kleen <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux