Skip to content

Updated X object manager policy -v2: Intro

Christopher J. PeBenito selinux-refpolicy 1 version New

Get series with b4
b4 am 1256908631.6392.79.camel@gorn

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [refpolicy] [PATCH 0/3] Updated X object manager policy -v2: Intro
Quoted 31 lines · Eamon Walsh
Quoted 15 lines · Christopher J. PeBenito
Quoted 6 lines · Eamon Walsh

This patch series is an updated policy for the X server object manager. This is the policy that I was running in Portland for my various demos. It includes new x_pointer/x_keyboard classes, unconfined-by-default user types, and other changes. The only thing missing here is updated mls constraints; I am still working on those.

Quoted 8 lines

The 3 patches here are NOT independent and breakage will probably result if only some of them are applied. I only broke them up in an attempt to make it easier to review the changes.

This is also available in a git tree at
git://anongit.freedesktop.org/~ewalsh/refpolicy (branch "master"), for ease of pulling.

Quoted 6 lines

This looks ok. I have this in a branch in my local repo for now, as I have a couple minor questions/issues:

1) +xserver_object_types_template(root)

Is this for the root window?

It defines the root_input_xevent_t type that is used for input events sent to the root window (if no other window has focus). This is new; before this patchset they were just labeled generic "input_xevent_t."

If other derived event types are reintroduced they will go in that template as well so calling it will define root_* variants that can be used.

Quoted 5 lines
Quoted 3 lines

2) The aliases that were removed need to be restored, and updated for the removals this patchset.

Are you referring to the type aliases here? What needs to be updated?

The ones like these that were removed:

-typealias user_property_xevent_t alias { staff_property_xevent_t sysadm_property_xevent_t }; -typealias user_property_xevent_t alias { auditadm_property_xevent_t secadm_property_xevent_t };

They shouldn't be removed, but they should be revised to make them aliases of the new types. So the above looks like it turns into:

typealias xevent_t alias { staff_property_xevent_t sysadm_property_xevent_t user_property_xevent_t }; typealias xevent_t alias { auditadm_property_xevent_t secadm_property_xevent_t };

or should it be aliased to client_xevent_t (I'm not sure)?

Quoted 7 lines
Quoted 3 lines

3) I'd like to try to find a better name for "xserver_unprotected", if possible.

Let's just drop this interface (attached patch). I'm not seeing the AVC's that motivated this anymore, probably because the default user types are X unconfined. If they show up again I can resubmit this.

Merged.

Quoted 85 lines

commit 509cc124f67abc46e9088c05dbe75e0f4d4c94a9

Author: Eamon Walsh <[email protected]>
Date:   Thu Oct 29 18:47:32 2009 -0400

Drop the xserver_unprotected interface.

The motivation for this was xdm_t objects not getting cleaned up, so the user session tried to interact with them. But since the default user type is unconfined this problem has gone away for now.

policy/modules/services/xserver.if +0 -20
index cffc058..e34a892 100644
@@ -1200,26 +1200,6 @@ interface(`xserver_manage_core_devices',`
 
 ########################################
 ## <summary>
-##     Interface to remove protections on an X client domain.
-##     Gives other X client domains full permissions over the target
-##     domain's X objects.
-## </summary>
-## <param name="domain">
-##     <summary>
-##     Domain to be unprotected.
-##     </summary>
-## </param>
-#
-interface(`xserver_unprotected',`
-       gen_require(`
-               attribute xserver_unprotected_type;
-       ')
-
-       typeattribute $1 xserver_unprotected_type;
-')
-
-########################################
-## <summary>
 ##     Interface to provide X object permissions on a given X server to
 ##     an X client domain.  Gives the domain complete control over the
 ##     display.
policy/modules/services/xserver.te +0 -16
index d6c4b95..f7e7637 100644
@@ -82,7 +82,6 @@ type root_xdrawable_t, xdrawable_type;
 type root_xcolormap_t, xcolormap_type;
 
 attribute xserver_unconfined_type;
-attribute xserver_unprotected_type;
 
 xserver_object_types_template(root)
 xserver_object_types_template(user)
@@ -157,7 +156,6 @@ init_daemon_domain(xdm_t, xdm_exec_t)
 xserver_object_types_template(xdm)
 xserver_common_x_domain_template(xdm, xdm_t)
 xserver_unconfined(xdm_t)
-xserver_unprotected(xdm_t)
 
 type xdm_lock_t;
 files_lock_file(xdm_lock_t)
@@ -950,20 +948,6 @@ allow x_domain xserver_t:x_screen { getattr saver_getattr };
 
 ########################################
 #
-# Rules for unprotected access to a domain
-#
-
-allow x_domain xserver_unprotected_type:x_drawable *;
-allow x_domain xserver_unprotected_type:x_gc *;
-allow x_domain xserver_unprotected_type:x_colormap *;
-allow x_domain xserver_unprotected_type:x_property *;
-allow x_domain xserver_unprotected_type:x_cursor *;
-allow x_domain xserver_unprotected_type:x_client *;
-allow x_domain xserver_unprotected_type:x_device *;
-allow x_domain xserver_unprotected_type:x_resource *;
-
-########################################
-#
 # Rules for unconfined access to this module
 #
 
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150