lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140127105413.GC11314@laptop.programming.kicks-ass.net>
Date:	Mon, 27 Jan 2014 11:54:13 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Tommi Rantala <tt.rantala@...il.com>
Cc:	Ingo Molnar <mingo@...hat.com>, Dave Jones <davej@...hat.com>,
	trinity@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: sched_rr_get_interval NULL pointer OOPS

On Fri, Jan 24, 2014 at 10:55:56PM +0200, Tommi Rantala wrote:
> Hello,
> 
> Trinity triggered the following bug in two separate qemu virtual
> machines after fuzzing v3.13-3995-g0dc3fd0 for a day or two. I have
> not been running Trinity in a while, so no idea if this is a
> regression or not.
> 
> If I'm reading this right, it's oopsing in kernel/sched/core.c:
> 
> SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
>     struct timespec __user *, interval)
> {
> ...
>     rq = task_rq_lock(p, &flags);
>     time_slice = p->sched_class->get_rr_interval(rq, p);   <==
>     task_rq_unlock(rq, p, &flags);
> ...


---
Subject: sched: make sched_class::get_rr_interval optional

Not all classes implement (or can implement) a useful get_rr_interval()
function, default to a 0 time-slice for them.

Reported-by: Tommi Rantala <tt.rantala@...il.com>
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
---
Index: linux-2.6/kernel/sched/core.c
===================================================================
--- linux-2.6.orig/kernel/sched/core.c
+++ linux-2.6/kernel/sched/core.c
@@ -4324,7 +4324,9 @@ SYSCALL_DEFINE2(sched_rr_get_interval, p
 		goto out_unlock;
 
 	rq = task_rq_lock(p, &flags);
-	time_slice = p->sched_class->get_rr_interval(rq, p);
+	time_slice = 0;
+	if (p->sched_class->get_rr_interval)
+		time_slice = p->sched_class->get_rr_interval(rq, p);
 	task_rq_unlock(rq, p, &flags);
 
 	rcu_read_unlock();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ