Re: [PATCH v7 1/3] x86: Add classes to exception tables

From: Borislav Petkov
Date: Fri Jan 08 2016 - 05:37:46 EST


On Thu, Jan 07, 2016 at 05:45:26PM -0800, Luck, Tony wrote:
> On Thu, Jan 07, 2016 at 01:11:31PM +0100, Borislav Petkov wrote:
> > Anyway, here's what I have, it boots fine in a guest.
> >
> > Btw, it seems I'm coming down with the cold and all that above could be
> > hallucinations so please double-check me.
>
> Hardly any hallucinations ... here's an update with the changes
> I mentioned in earlier e-mail. Boots on actual h/w.

Cool, thanks for fixing it up. Looks good to me. Feel free to make it
into a proper patch and add it to your series... unless you want me to
do it.

Just one small question below:

> diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
> index 903ec1e9c326..01098ad010dd 100644
> --- a/arch/x86/mm/extable.c
> +++ b/arch/x86/mm/extable.c
> @@ -3,6 +3,8 @@
> #include <linux/sort.h>
> #include <asm/uaccess.h>
>
> +typedef int (*ex_handler_t)(const struct exception_table_entry *, struct pt_regs *, int);
> +
> static inline unsigned long
> ex_insn_addr(const struct exception_table_entry *x)
> {
> @@ -14,10 +16,39 @@ ex_fixup_addr(const struct exception_table_entry *x)
> return (unsigned long)&x->fixup + x->fixup;
> }
>
> -int fixup_exception(struct pt_regs *regs)
> +int ex_handler_default(const struct exception_table_entry *fixup,
> + struct pt_regs *regs, int trapnr)
> {
> - const struct exception_table_entry *fixup;
> - unsigned long new_ip;
> + regs->ip = ex_fixup_addr(fixup);
> + return 1;
> +}
> +EXPORT_SYMBOL(ex_handler_default);

Why not EXPORT_SYMBOL_GPL() ?

We do not care about external modules.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.