Re: [PATCH] msr: Fix NULL pointer deref due to msr_open onnonexistent CPUs

From: Ingo Molnar
Date: Fri Aug 15 2008 - 07:39:15 EST



* Darrick J. Wong <djwong@xxxxxxxxxx> wrote:

> msr_open tests for someone trying to open a device for a nonexistent CPU.
> However, the function always returns 0, not ret like it should, hence userspace
> can BUG the kernel trivially. This bug was introduced by the cdev lock_kernel
> pushdown patch last May.
>
> The BUG can be reproduced with these commands:
>
> # mknod fubar c 202 8 <-- pick a number less than NR_CPUS that is not
> the number of an online CPU
> # cat fubar

applied to tip/x86/urgent - thanks Darrick.

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/