Re: [PATCH] modules fix incorrect percpu usage

From: Tejun Heo
Date: Tue Mar 30 2010 - 22:17:10 EST


On 03/31/2010 11:03 AM, Steven Rostedt wrote:
> I don't know. A possible "NULL pointer dereference" seems to me to be a
> pretty big user visible impact.
>
> I guess the question is, what's the risk of adding this change?

AFAICS, the risk is fairly low. per_cpu_ptr(pcpudest, cpu) is
SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) which is just a fancy
way of saying "typeof(ptr)((unsigned long)(ptr) + per_cpu_offset(cpu))"
with enough obfuscation to prevent gcc from optimizing it incorrectly.

Thanks.

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