Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Access to DRM render nodes from portage sandbox?
Date: Wed, 09 May 2018 08:16:50
Message-Id: 1525853799.1846.2.camel@gentoo.org
In Reply to: Re: [gentoo-dev] Access to DRM render nodes from portage sandbox? by Dennis Schridde
1 W dniu śro, 09.05.2018 o godzinie 09∶56 +0200, użytkownik Dennis
2 Schridde napisał:
3 > On Wednesday, 9 May 2018 09:34:43 CEST Michał Górny wrote:
4 > > W dniu śro, 09.05.2018 o godzinie 08∶51 +0200, użytkownik Dennis
5 > >
6 > > Schridde napisał:
7 > > > I see sandbox violations similar to "ACCESS DENIED: open_wr: /dev/dri/
8 > > > renderD128" pop up for more and more packages, probably since OpenCL
9 > > > becomes used more widely. Hence I would like to ask: Could we in Gentoo
10 > > > treat GPUs just like CPUs and allow any process to access render nodes
11 > > > (i.e. the GPUs compute capabilities via the specific interface the Linux
12 > > > kernel's DRM offers for that purpose) without sandbox restrictions?
13 > > >
14 > > > See-Also: https://bugs.gentoo.org/654216
15 > >
16 > > Doesn't accessing those nodes involve a risk of programs being able to
17 > > crash your system (or xorg)? Or cause on-screen artifacts?
18 >
19 > Well, in the presence of Linux kernel bugs, programs could crash the whole
20 > system. But I believe this is also true for all other drivers and compute
21 > devices, including CPUs.
22 >
23 > I assume an application using render nodes could crash X by e.g. consuming all
24 > memory. But then this is also true for all applications using the CPU and its
25 > attached memory for computations.
26 >
27 > On-screen artifacts as in resolution switching and other KMS operations is
28 > explicitly prohibited. Insecure access (using GEM FLINK) to the memory of
29 > other applications (which could cause broken textures / windows with broken
30 > content) is also explicitly prohibited. So my understanding is that the
31 > answer is: No, using render nodes cannot cause on-screen artifacts (modulo the
32 > presence of Linux kernel bugs, s.a.).
33 >
34 > DRM render nodes were specifically introduced to allow GPGPU applications to
35 > run without impacting the security of the system (and without X).
36 >
37
38 Ok then. I suppose I was confusing it with /dev/nvidia*.
39
40 --
41 Best regards,
42 Michał Górny