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, 12 May 2014 17:25:36 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
Cc:	Juri Lelli <juri.lelli@...il.com>,
	Dario Faggioli <raistlin@...ux.it>,
	lkml <linux-kernel@...r.kernel.org>,
	linux-man <linux-man@...r.kernel.org>
Subject: Re: SCHED_DEADLINE, sched_getscheduler(), and sched_getparam()

On Mon, May 12, 2014 at 02:33:42PM +0200, Michael Kerrisk (man-pages) wrote:
> > I'm a proponent of fail hard instead of fail silently and muddle on.
> > And while we can fully and correctly return sched_getscheduler() we
> > cannot do so for sched_getparam().
> >
> > Returning sched_param::sched_priority == 0 for DEADLINE would also break
> > the symmetry between sched_setparam() and sched_getparam(), both will
> > fail for SCHED_DEADLINE.
> 
> Maybe. But there seems to me to be a problem with your logic here.
> (And the symmetry argument seems a weak one to me.)
> 
> I mean, applications that are currently using sched_getscheduler()
> will now get back a new policy (SCHED_DEADLINE) that they may not
> understand, and so they may break.
> 
> On the other hand, applications that call sched_getparam() will fail
> with EINVAL, even though sched_priority has no meaning for
> SCHED_DEADLINE (as for the non-real-time policies), and so it would
> seem to be harmless to succeed and return a sched_priority of 0 in
> this case. It seems to break user-space needlessly, IMHO.
> 
> If anything, I'd have said it would have made more sense to have the
> sched_getscheduler() case fail, while having the sched_getparam() case
> succeed. (But, I can see the argument for having _both_ cases
> succeed.)

Hmm,.. maybe. Can we still change this? Again, maybe, there's not really
that much userspace that relies on this.

In any case, the way I read the little there is on getparam() it seems
to imply the only case where it does make sense to call it at all is
when sched_getscheduler() returns either SCHED_FIFO or SCHED_RR.

And in that sense I suppose the precedent for all other currently
available classes to not fail the param call but return 0 should be
extended.

If only we'd started out with sched_yield()/sched_getparam() etc failing
when not !SCHED_FIFO/RR :-)

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ