[Mesa-dev] [PATCH] gallium/util: don't let children of fork & exec inherit our thread affinity
Michel Dänzer
michel at daenzer.net
Fri Sep 14 09:41:11 UTC 2018
On 2018-09-14 10:53 a.m., Michel Dänzer wrote:
> On 2018-09-13 8:56 p.m., Marek Olšák wrote:
>
>> + * What happens if a driver is unloaded and the app creates a thread?
>
> I suppose the child process will likely crash, because the memory
> address where util_set_full_cpu_affinity was located will either be
> unmapped or have random other contents?
>
> At least in theory, there could also be an issue where the application
> might have set its own thread affinity before calling fork, which would
> be clobbered by util_set_full_cpu_affinity in the child process.
Note that these two issues only apply to spawning a child process with
fork, not to spawning a thread in the same process.
BTW, Julien Cristau pointed out on IRC that setting the thread affinity
also seems to cause trouble with Firefox's sandbox. I'm seeing messages
like
Sandbox: seccomp sandbox violation: pid 3039, tid 3039, syscall 203, args 3105 128 140733772165072 1 16 140515081189120.
with Firefox 62, but apparently it can even crash with Firefox nightly
at least: https://bugzilla.mozilla.org/1490994
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the mesa-dev
mailing list