All of lore.kernel.org
 help / color / mirror / Atom feed
From: cpebenito@tresys.com (Christopher J. PeBenito)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH 1/3] Label Xorg server binary correctly on Arch Linux
Date: Tue, 5 Jan 2016 13:38:37 -0500	[thread overview]
Message-ID: <568C0DAD.3050508@tresys.com> (raw)
In-Reply-To: <1450625330-21892-1-git-send-email-nicolas.iooss@m4x.org>

On 12/20/2015 10:28 AM, Nicolas Iooss wrote:
> On Arch Linux, /usr/bin/Xorg is only a shell script which executes
> /usr/lib/xorg-server/Xorg.wrap, which is a SUID binary wrapper around
> /usr/lib/xorg-server/Xorg.
> 
> Even though Xorg.wrap is not a full X server, it reads X11 configuration
> files, uses the DRM interface to detect KMS, etc. (cf.
> http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/xorg-wrapper.c?id=xorg-server-1.18.0
> for more details).  Therefore label it as xserver_exec_t.
> 
> This makes the following AVC appear:
> 
>     denied  { execute_no_trans } for  pid=927 comm="X"
>     path="/usr/lib/xorg-server/Xorg.wrap" dev="dm-0" ino=3152592
>     scontext=system_u:system_r:xserver_t
>     tcontext=system_u:object_r:xserver_exec_t tclass=file
> 
> Allow /usr/bin/Xorg to execute Xorg.wrap with a can_exec statement.
> ---
>  policy/modules/services/xserver.fc | 2 ++
>  policy/modules/services/xserver.te | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/policy/modules/services/xserver.fc b/policy/modules/services/xserver.fc
> index 71b307c2fbea..397993fb4944 100644
> --- a/policy/modules/services/xserver.fc
> +++ b/policy/modules/services/xserver.fc
> @@ -70,6 +70,8 @@ HOME_DIR/\.Xauthority.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
>  /usr/bin/Xorg		--	gen_context(system_u:object_r:xserver_exec_t,s0)
>  
>  /usr/lib/qt-.*/etc/settings(/.*)? gen_context(system_u:object_r:xdm_var_run_t,s0)
> +/usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
> +/usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
>  
>  /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
>  
> diff --git a/policy/modules/services/xserver.te b/policy/modules/services/xserver.te
> index 2ba7a7415e2a..8dc7c83e491c 100644
> --- a/policy/modules/services/xserver.te
> +++ b/policy/modules/services/xserver.te
> @@ -827,6 +827,9 @@ manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
>  allow xserver_t xkb_var_lib_t:lnk_file read;
>  can_exec(xserver_t, xkb_var_lib_t)
>  
> +# Run Xorg.wrap
> +can_exec(xserver_t, xserver_exec_t)
> +
>  # VNC v4 module in X server
>  corenet_tcp_bind_vnc_port(xserver_t)

Merged.

-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

      parent reply	other threads:[~2016-01-05 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-20 15:28 [refpolicy] [PATCH 1/3] Label Xorg server binary correctly on Arch Linux Nicolas Iooss
2015-12-20 15:28 ` [refpolicy] [PATCH 2/3] Label OpenSSH files " Nicolas Iooss
2016-01-05 18:38   ` Christopher J. PeBenito
2015-12-20 15:28 ` [refpolicy] [PATCH 3/3] Label OpenSSH systemd unit files Nicolas Iooss
2016-01-05 18:38   ` Christopher J. PeBenito
2016-01-05 18:38 ` Christopher J. PeBenito [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568C0DAD.3050508@tresys.com \
    --to=cpebenito@tresys.com \
    --cc=refpolicy@oss.tresys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.