Research
.
Skip Search Box

SELinux Mailing List

SysV shared memory segments and X

From: Eamon Walsh <ewalsh_at_tycho.nsa.gov>
Date: Tue, 22 May 2007 16:27:42 -0400


Having reviewed the various X protocol extensions I can comment on the way X uses shared memory segments, following up on the threads concerning labeling of shared memory segments:

http://marc.info/?l=selinux&m=115401962007617&w=2 http://marc.info/?l=selinux&m=115765873100144&w=2

X server uses shared memory to talk to client applications in two places: sharing of image data and sharing of font metrics.

In the former case, the client application creates the shared memory segment and passes the ID through the protocol to the X server which attaches to it. Then client can read/write image data to the segment using ShmPutImage, ShmGetImage, etc. When attaching, the X server calls getpeercred() on the client's UNIX socket and manually checks the values against the ownership and permissions of the segment. This check was apparently buggy for some years:

http://www.securityfocus.com/bid/4396/discuss

In the latter case, which is different since the font metrics are read-only, the _server_ creates a world-readable shared memory segment and passes its ID to the client which attaches to it to read out the font metrics.

--

Eamon Walsh <ewalsh@tycho.nsa.gov>
National Security Agency

--

This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message. Received on Tue 22 May 2007 - 16:27:57 EDT

 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service