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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1704061259580.1716@nanos>
Date:   Thu, 6 Apr 2017 13:03:16 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Peter Zijlstra <peterz@...radead.org>
cc:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        linux-kernel@...r.kernel.org, Mike Galbraith <efault@....de>,
        Ingo Molnar <mingo@...e.hu>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>
Subject: Re: [RFC PATCH] kernel: sched: Provide a pointer to the valid CPU
 mask

On Thu, 6 Apr 2017, Peter Zijlstra wrote:
> On Thu, Apr 06, 2017 at 12:47:21PM +0200, Thomas Gleixner wrote:
> > On Thu, 6 Apr 2017, Peter Zijlstra wrote:
> 
> > > IIRC MIPS has a case where only 1 in N cores has an FPU. And once a task
> > > uses FPU, it gets affined to the core that has one or something like
> > > that.
> > >
> > > Of course, nothing then stops someone else breaking that affinity. But I
> > > suspect it will simply fault on the next FPU instruction and 'reset' the
> > > mask or something. I've no clue and no real desire to know.
> > 
> > It does nasty games with it's own storage of p->thread.user_cpus_allowed
> > and a fully seperate implementation of sys_sched_set|getaffinity.
> > 
> > Plus a magic trap handler which forces the thread to a CPU with FPU when
> > the user_cpus_allowed mask intersects with the cpus_with_fpu_mask...
> > 
> > Magic crap, which could all be replaced by a simple function in the
> > scheduler which allows to push a task to a FPU CPU and then disable
> > migration.
> 
> If its even halfway coherent, I'd much rather let it stay where it it.
> 
> I really want to limit migrate_disable() to PREEMPT_RT=y where its used
> to preserve spinlock semantics and not allow random other
> migrate_disable() usage in the kernel.
> 
> Also note, that per the above, it can actually migrate to any core that
> has an FPU on, so its not a good match for migrate_disable() in any
> case.

Fair enough, but I prefer to have the ability for a temporary restriction
of the user space visible cpus allowed mask in the core code, which can be
used for both migrate_disable() and things like that MIPS FPU stuff rather
than all those home brewn hackeries which are prone to bitrot, security
issues and subtle wreckage. cpus_allowed should be solely under sched core
control and not accessible from anything outside.

Thanks,

	tglx



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ