projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a33a052
)
posix-timers: Fix oops in clock_nanosleep() with CLOCK_MONOTONIC_RAW
author
Hiroshi Shimamoto
<
[email protected]
>
Mon, 3 Aug 2009 02:48:19 +0000
(11:48 +0900)
committer
Ingo Molnar
<
[email protected]
>
Tue, 4 Aug 2009 08:16:41 +0000
(10:16 +0200)
Prevent calling do_nanosleep() with clockid
CLOCK_MONOTONIC_RAW, it may cause oops, such as NULL pointer
dereference.
Signed-off-by: Hiroshi Shimamoto <
[email protected]
>
Cc: Andrew Morton <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc: John Stultz <
[email protected]
>
Cc: <
[email protected]
>
LKML-Reference: <
4A764FF3
[email protected]
>
Signed-off-by: Ingo Molnar <
[email protected]
>
kernel/posix-timers.c
patch
|
blob
|
history
diff --git
a/kernel/posix-timers.c
b/kernel/posix-timers.c
index 052ec4d195c7d1ee68fc3b5f9eeb422b932bb3b5..d089d052c4a90f18bb908724e93806f86d0e11aa 100644
(file)
--- a/
kernel/posix-timers.c
+++ b/
kernel/posix-timers.c
@@
-202,6
+202,12
@@
static int no_timer_create(struct k_itimer *new_timer)
return -EOPNOTSUPP;
}
+static int no_nsleep(const clockid_t which_clock, int flags,
+ struct timespec *tsave, struct timespec __user *rmtp)
+{
+ return -EOPNOTSUPP;
+}
+
/*
* Return nonzero if we know a priori this clockid_t value is bogus.
*/
@@
-254,6
+260,7
@@
static __init int init_posix_timers(void)
.clock_get = posix_get_monotonic_raw,
.clock_set = do_posix_clock_nosettime,
.timer_create = no_timer_create,
+ .nsleep = no_nsleep,
};
register_posix_clock(CLOCK_REALTIME, &clock_realtime);