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: <20150106141012.GY29390@twins.programming.kicks-ass.net>
Date:	Tue, 6 Jan 2015 15:10:12 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc:	mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Fix RCU stall upon ENOMEM at
 sched_create_group().

On Thu, Dec 25, 2014 at 10:10:45PM +0900, Tetsuo Handa wrote:
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ef2b104..586ee15 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7756,8 +7756,12 @@ static void task_move_group_fair(struct task_struct *p, int queued)
>  void free_fair_sched_group(struct task_group *tg)
>  {
>  	int i;
> +	struct cfs_bandwidth *cfs_b;
>  
> -	destroy_cfs_bandwidth(tg_cfs_bandwidth(tg));
> +	/* Check whether init_cfs_bandwidth() was called. */
> +	cfs_b = tg_cfs_bandwidth(tg);
> +	if (cfs_b->throttled_cfs_rq.next)
> +		destroy_cfs_bandwidth(cfs_b);
>  
>  	for_each_possible_cpu(i) {
>  		if (tg->cfs_rq)

This doesn't actually compile for !CONFIG_CFS_BANDWIDTH, how about:

---
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4005,6 +4005,10 @@ void __start_cfs_bandwidth(struct cfs_ba
 
 static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
 {
+	/* init_cfs_bandwidth() was not called */
+	if (!cfs_b->throttled_cfs_rq.next)
+		return;
+
 	hrtimer_cancel(&cfs_b->period_timer);
 	hrtimer_cancel(&cfs_b->slack_timer);
 }
--
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