Re: [PATCH 2/3] perf, x86: Don't leak kernel data via callchains

From: Linus Torvalds
Date: Fri Apr 20 2012 - 15:57:20 EST


On Fri, Apr 20, 2012 at 12:35 PM, Arun Sharma <asharma@xxxxxx> wrote:
>
> +       set_fs(USER_DS);

NAK.

I really don't think this is the right thing to do. We're in random
NMI context, set_fs() is not at all necessarily safe.

No, the code needs to check the frame range by hand, not depend on current-fs.

In fact, I'd argue that this is a bug in copy_from_user_nmi(), which
should simply check the *user* address space explicitly, not using
access_ok().

Linus
--
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/