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: <YP6++lClPCQvTLcK@google.com>
Date:   Mon, 26 Jul 2021 14:56:10 +0100
From:   Quentin Perret <qperret@...gle.com>
To:     Dietmar Eggemann <dietmar.eggemann@....com>
Cc:     mingo@...hat.com, peterz@...radead.org, vincent.guittot@...aro.org,
        qais.yousef@....com, rickyiu@...gle.com, wvw@...gle.com,
        patrick.bellasi@...bug.net, xuewen.yan94@...il.com,
        linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH v4 2/2] sched: Skip priority checks with
 SCHED_FLAG_KEEP_PARAMS

On Thursday 22 Jul 2021 at 10:47:33 (+0200), Dietmar Eggemann wrote:
> (*) This changes the behaviour when setting uclamp values on a DL task.
> 
> Before uclamp values could be set but now, because of
> 
>   void __getparam_dl(struct task_struct *p, struct sched_attr *attr)
>     ..
>     attr->sched_flags = dl_se->flags
> 
> SCHED_FLAG_UTIL_CLAMP gets overwritten and  __sched_setscheduler() bails in:
> 
>     if (unlikely(policy == p->policy)) {
>       ...
>       retval = 0;
>       goto unlock;
>     }
>   change:
> 
> I.e. the:
> 
>       if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP)
>         goto change;
> 
> can't trigger anymore.

Bah, as you said it doesn't seem to be a big deal, but clearly that was
unintentional. Let me try and fix this.

> > +	else if (task_has_rt_policy(p))
> > +		attr->sched_priority = p->rt_priority;
> > +	else
> > +		attr->sched_nice = task_nice(p);
> > +}
> > +
> >  /**
> >   * sys_sched_setscheduler - set/change the scheduler policy and RT priority
> >   * @pid: the pid in question.
> > @@ -7393,6 +7403,8 @@ SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
> >  	rcu_read_unlock();
> >  
> >  	if (likely(p)) {
> > +		if (attr.sched_flags & SCHED_FLAG_KEEP_PARAMS)
> > +			get_params(p, &attr);
> 
> SCHED_FLAG_KEEP_PARAMS is handled here but SCHED_FLAG_KEEP_POLICY
> outside (before) the `if (likely(p))`?

Because I need to dereference p while SCHED_FLAG_KEEP_POLICY doesn't :)

> >  		retval = sched_setattr(p, &attr);
> >  		put_task_struct(p);
> >  	}
> 
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ