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:   Thu, 29 Jul 2021 18:26:40 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Quentin Perret <qperret@...gle.com>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] sched/deadline: Fix reset_on_fork reporting of DL
 tasks

On 27/07/2021 12:11, Quentin Perret wrote:
> It is possible for sched_getattr() to incorrectly report the state of
> the reset_on_fork flag when called on a deadline task.
> 
> Indeed, if the flag was set on a deadline task using sched_setattr()
> with flags (SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS), then
> p->sched_reset_on_fork will be set, but __setscheduler() will bail out
> early, which means that the dl_se->flags will not get updated by
> __setscheduler_params()->__setparam_dl(). Consequently, if

True, but it would also be awkward if non-DL related flags would have to
be stored in dl_se->flags.

> sched_getattr() is then called on the task, __getparam_dl() will
> override kattr.sched_flags with the now out-of-date copy in dl_se->flags
> and report the stale value to userspace.
> 
> To fix this, make sure to only copy the flags that are relevant to
> sched_deadline to and from the dl_se->flags field.

It also fixes the 'hidden' issue that a

    uclampset -mX -MY -p dl_task

would end up at 'change:' label because of

    dl_se->flags != attr->sched_flags

and not because of

    attr->sched_flags & SCHED_FLAG_UTIL_CLAMP


And it also unblocks the uclamp-dl issue raised in
https://lkml.kernel.org/r/ad30be79-8fb2-023d-9936-01f7173164e4@arm.com
which surfaced when using `get_params()->__getparam_dl()` in
SYSCALL_DEFINE3(sched_setattr,...).
Just for reference, IIRC, you mentioned this already on irc.

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@....com>

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ