Re: [PATCH] posix-timers: fix oops in clock_nanosleep() with CLOCK_MONOTONIC_RAW

From: Hiroshi Shimamoto
Date: Tue Aug 04 2009 - 04:08:13 EST


Andrew Morton wrote:
> On Tue, 04 Aug 2009 16:41:33 +0900 Hiroshi Shimamoto <h-shimamoto@xxxxxxxxxxxxx> wrote:
>
>> Userspace program is like this;
>>
>> #include <time.h>
>>
>> int main(void)
>> {
>> struct timespec ts;
>>
>> ts.tv_sec = 1;
>> ts.tv_nsec = 0;
>>
>> return clock_nanosleep(4, 0, &ts, NULL);
>> }
>>
>> and it will cause oops;
>>
>> BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
>
> Well that's not very good.
>
> How far back does this go? posix-timers.c hasn't changed in several
> kernel versions.

Not sure the exact version is. I've just noticed it on the latest git and
Fedora 11.
I guess after the below commit;
commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68
Author: John Stultz <johnstul@xxxxxxxxxx>
Date: Wed Aug 20 16:37:30 2008 -0700

clocksource: introduce CLOCK_MONOTONIC_RAW

thanks,
Hiroshi
--
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/