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]
Date:   Mon, 5 Nov 2018 16:29:30 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Olof Johansson <olof@...om.net>
Cc:     Johannes Weiner <hannes@...xchg.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH] psi: simplify cgroup_move_task

On Sat,  3 Nov 2018 11:33:39 -0700 Olof Johansson <olof@...om.net> wrote:

> The existing code triggered an invalid warning about 'rq' possibly being
> used uninitialized. Instead of doing the silly warning suppression by
> initializa it to NULL, refactor the code to bail out early instead.
> 
> Warning was:
> 
> kernel/sched/psi.c: In function ‘cgroup_move_task’:
> kernel/sched/psi.c:639:13: warning: ‘rq’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -633,38 +633,39 @@ void psi_cgroup_free(struct cgroup *cgroup)
>   */
>  void cgroup_move_task(struct task_struct *task, struct css_set *to)
>  {
> -	bool move_psi = !psi_disabled;
>  	unsigned int task_flags = 0;
>  	struct rq_flags rf;
>  	struct rq *rq;
>  
> -	if (move_psi) {
> -		rq = task_rq_lock(task, &rf);
> +	if (psi_disabled) {
> +		/*
> +		 * Lame to do this here, but the scheduler cannot be locked
> +		 * from the outside, so we move cgroups from inside sched/.
> +		 */
> +		rcu_assign_pointer(task->cgroups, to);
> +		return;
> +	}

Fair enough.

Surprisingly this doesn't increase psi.o text size.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ