/[linux-patches]/genpatches-2.6/trunk/2.6.30/1505_fix-oops-in-clock-nanosleep.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.30/1505_fix-oops-in-clock-nanosleep.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1595 - (show annotations) (download) (as text)
Fri Aug 14 11:25:55 2009 UTC (11 years, 3 months ago) by mpagano
File MIME type: text/x-diff
File size: 1566 byte(s)
Fix for (CVE-2009-2692), Kernel: NULL pointer dereference due to incorrect proto_ops initializations. Fix for Linux Kernel clock_nanosleep() NULL Pointer Dereference, SA36200. Security hid dereference before null check fix. New patch for fbcondecor.
1 From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
2 Date: Mon, 3 Aug 2009 02:48:19 +0000 (+0900)
3 Subject: posix-timers: Fix oops in clock_nanosleep() with CLOCK_MONOTONIC_RAW
4 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=70d715fd0597f18528f389b5ac5910226306774
5
6 posix-timers: Fix oops in clock_nanosleep() with CLOCK_MONOTONIC_RAW
7
8 Prevent calling do_nanosleep() with clockid
9 CLOCK_MONOTONIC_RAW, it may cause oops, such as NULL pointer
10 dereference.
11
12 Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
13 Cc: Andrew Morton <akpm@linux-foundation.org>
14 Cc: Thomas Gleixner <tglx@linutronix.de>
15 Cc: John Stultz <johnstul@us.ibm.com>
16 Cc: <stable@kernel.org>
17 LKML-Reference: <4A764FF3.50607@ct.jp.nec.com>
18 Signed-off-by: Ingo Molnar <mingo@elte.hu>
19 ---
20
21 diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
22 index 052ec4d..d089d05 100644
23 --- a/kernel/posix-timers.c
24 +++ b/kernel/posix-timers.c
25 @@ -202,6 +202,12 @@ static int no_timer_create(struct k_itimer *new_timer)
26 return -EOPNOTSUPP;
27 }
28
29 +static int no_nsleep(const clockid_t which_clock, int flags,
30 + struct timespec *tsave, struct timespec __user *rmtp)
31 +{
32 + return -EOPNOTSUPP;
33 +}
34 +
35 /*
36 * Return nonzero if we know a priori this clockid_t value is bogus.
37 */
38 @@ -254,6 +260,7 @@ static __init int init_posix_timers(void)
39 .clock_get = posix_get_monotonic_raw,
40 .clock_set = do_posix_clock_nosettime,
41 .timer_create = no_timer_create,
42 + .nsleep = no_nsleep,
43 };
44
45 register_posix_clock(CLOCK_REALTIME, &clock_realtime);
46

  ViewVC Help
Powered by ViewVC 1.1.20