Skip to contentSkip to conversation

shm denials

DISCUSSION Ivan Gyurdiev 2 participants 5 messages Feb 12, 2005 – Mar 8, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

I'm wondering if the following are caused by the Nvidia driver I use. This is GL stuff trying to use shmat()/shmdt(). The first is a GL game. The last few are GL screensavers shipped by Fedora. The denials are annoying. Can anyone with Mesa GL test to see if Nvidia's library is causing this?

audit(1108172859.969:0): avc: denied { execute } for pid=17617 comm=ut2004-bin path=/SYSV00000000 (deleted) dev=tmpfs ino=46366738 scontext=user_u:user_r:user_t tcontext=user_u:object_r:user_tmpfs_t tclass=file

audit(1108172873.539:0): avc: denied { write execute } for pid=17617 comm=ut2004-bin path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

audit(1108185116.592:0): avc: denied { write } for pid=18105 comm=bubble3d path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

audit(1108199240.780:0): avc: denied { write } for pid=20961 comm=blinkbox path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

audit(1108204054.842:0): avc: denied { write } for pid=22418 comm=morph3d path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

audit(1108207062.099:0): avc: denied { write } for pid=22597 comm=gflux path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 9 lines · Ivan Gyurdiev

audit(1108172859.969:0): avc: denied { execute } for pid=17617 comm=ut2004-bin path=/SYSV00000000 (deleted) dev=tmpfs ino=46366738 scontext=user_u:user_r:user_t tcontext=user_u:object_r:user_tmpfs_t tclass=file

audit(1108172873.539:0): avc: denied { write execute } for pid=17617 comm=ut2004-bin path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

The attempt to execute is odd; might be due to a legacy binary and the present read-implies-execute logic in the kernel. There is some discussion of changing the kernel to pass the original protection to SELinux rather than the modified one, so that SELinux will only check the protection requested by the application and legacy binaries won't trigger these denials.

Quoted 4 lines

audit(1108185116.592:0): avc: denied { write } for pid=18105 comm=bubble3d path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

There are rules in the policy allowing read access for user domains and x client program domains to this type, to support shared memory communication with X as an optimization. I would have expected the writes to occur to a shared memory object created by the user domain / x client domain (and thus labeled with user_tmpfs_t) that would then be read by X, but this seems to be a direct write to the shared memory object created by X. I would expect the application to fall back to the slower IPC-based communication mechanism if this fails, so it shouldn't be fatal, but someone might want to assess the risk posed by allowing it (e.g. can a user domain / x client domain corrupt X by such direct writing to a shared memory object created by X).

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 13 lines

There are rules in the policy allowing read access for user domains and x client program domains to this type, to support shared memory communication with X as an optimization. I would have expected the writes to occur to a shared memory object created by the user domain / x client domain (and thus labeled with user_tmpfs_t) that would then be read by X, but this seems to be a direct write to the shared memory object created by X. I would expect the application to fall back to the slower IPC-based communication mechanism if this fails, so it shouldn't be fatal, but someone might want to assess the risk posed by allowing it (e.g. can a user domain / x client domain corrupt X by such direct writing to a shared memory object created by X).

True, this seems to cut OpenGL performance in half.

Enforcing mode:

8071 frames in 5.0 seconds = 1614.200 FPS
9480 frames in 5.0 seconds = 1896.000 FPS
9480 frames in 5.0 seconds = 1896.000 FPS

Permissive mode / Enforcing mode with this allowed:

13682 frames in 5.0 seconds = 2736.400 FPS
14729 frames in 5.0 seconds = 2945.800 FPS
14694 frames in 5.0 seconds = 2938.800 FPS
14718 frames in 5.0 seconds = 2943.600 FPS
14640 frames in 5.0 seconds = 2928.000 FPS

audit(1108395306.088:0): avc: denied { write } for pid=11720 comm=glxgears path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
Quoted 16 lines · Ivan Gyurdiev

True, this seems to cut OpenGL performance in half.

Enforcing mode:

8071 frames in 5.0 seconds = 1614.200 FPS
9480 frames in 5.0 seconds = 1896.000 FPS
9480 frames in 5.0 seconds = 1896.000 FPS

Permissive mode / Enforcing mode with this allowed:

13682 frames in 5.0 seconds = 2736.400 FPS
14729 frames in 5.0 seconds = 2945.800 FPS
14694 frames in 5.0 seconds = 2938.800 FPS
14718 frames in 5.0 seconds = 2943.600 FPS
14640 frames in 5.0 seconds = 2928.000 FPS

Quoted 4 lines

audit(1108395306.088:0): avc: denied { write } for pid=11720 comm=glxgears path=/SYSV00000000 (deleted) dev=tmpfs ino=38338560 scontext=user_u:user_r:user_t tcontext=system_u:object_r:xdm_xserver_tmpfs_t tclass=file

Yes, no surprise there. Again, someone would need to assess the risk posed by allowing it (e.g. does X create any shared memory objects that should not be directly writable by the user domains, what safeguards does X apply in handling the potentially malicious data from the shared memory object, etc). Possibly a candidate for a boolean.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
Quoted 7 lines

Yes, no surprise there. Again, someone would need to assess the risk posed by allowing it (e.g. does X create any shared memory objects that should not be directly writable by the user domains, what safeguards does X apply in handling the potentially malicious data from the shared memory object, etc). Possibly a candidate for a boolean.

Should I cross-post this to X-devel for discussion? What needs to be done to ensure this issue is not forgotten?

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.