Skip to contentSkip to conversation

selection labeling

DISCUSSION Eamon Walsh 3 participants 4 messages Mar 18, 2008 – Mar 20, 2008 1 message not in the archive SELinux security module

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 9 lines · Christopher J. PeBenito

I ran into an interesting denial:

avc: denied { setattr setattr } for request=X11:SetSelectionOwner comm=dbus-launch selection=_DBUS_SESSION_BUS_SELECTION_root_3c39a16f05862d57c3d6ef0047356754 scontext=root:staff_r:staff_t tcontext=system_u:object_r:xselection_t
tclass=x_selection

Quoted 4 lines

Other than the double setattr in the permissions, trying to label this selection for anything but the default doesn't seem possible. It seems that this should be type_transitioned, but it didn't seem to work.

Whoops, I know why the double setattr is there. I'll get that fixed, ignore that for now.

We probably need to have wildcarding in the X label support, like the way filenames work. Do you agree?

But I don't have a clue why D-BUS is creating selections with those insane names. It looks like abuse of the selection mechanism to me. Selections are used for IPC, hence they're supposed to have fixed, standard names. Actually it doesn't make sense to me that D-BUS is using selections at all.

Signature · 8 lines
Eamon Walsh <[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 18 lines · Eamon Walsh
Quoted 9 lines · Christopher J. PeBenito

I ran into an interesting denial:

avc: denied { setattr setattr } for request=X11:SetSelectionOwner comm=dbus-launch selection=_DBUS_SESSION_BUS_SELECTION_root_3c39a16f05862d57c3d6ef0047356754 scontext=root:staff_r:staff_t tcontext=system_u:object_r:xselection_t
tclass=x_selection

Quoted 4 lines

Other than the double setattr in the permissions, trying to label this selection for anything but the default doesn't seem possible. It seems that this should be type_transitioned, but it didn't seem to work.

Whoops, I know why the double setattr is there. I'll get that fixed, ignore that for now.

Quoted 9 lines

We probably need to have wildcarding in the X label support, like the way filenames work. Do you agree?

But I don't have a clue why D-BUS is creating selections with those insane names. It looks like abuse of the selection mechanism to me. Selections are used for IPC, hence they're supposed to have fixed, standard names. Actually it doesn't make sense to me that D-BUS is using selections at all.

The last part is the session bus's unique id. The id is also set in the environment variable, DBUS_SESSION_BUS_ADDRESS.

Signature · 8 lines
James Carter <[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.
#3 lore raw
In reply to Eamon Walsh
Quoted 15 lines · Eamon Walsh
Quoted 9 lines · Christopher J. PeBenito

I ran into an interesting denial:

avc: denied { setattr setattr } for request=X11:SetSelectionOwner comm=dbus-launch selection=_DBUS_SESSION_BUS_SELECTION_root_3c39a16f05862d57c3d6ef0047356754 scontext=root:staff_r:staff_t tcontext=system_u:object_r:xselection_t
tclass=x_selection

Quoted 4 lines

Other than the double setattr in the permissions, trying to label this selection for anything but the default doesn't seem possible. It seems that this should be type_transitioned, but it didn't seem to work.

Quoted 5 lines

Whoops, I know why the double setattr is there. I'll get that fixed, ignore that for now.

We probably need to have wildcarding in the X label support, like the way filenames work. Do you agree?

This is the role's session bus, not the system bus, so the preference would be to have a type_transition so the selection would be staff_dbus_xselection_t. I don't see how we could get this behavior in x_contexts except by putting in entries for all of the users, which would be suboptimal. Especially since in this case where I logged in as root/staff_r; I could also log in as root/sysadm_r and then in that case we have a problem since the label would be wrong in one of those cases.

Quoted 5 lines

But I don't have a clue why D-BUS is creating selections with those insane names. It looks like abuse of the selection mechanism to me. Selections are used for IPC, hence they're supposed to have fixed, standard names. Actually it doesn't make sense to me that D-BUS is using selections at all.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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 23 lines · Christopher J. PeBenito
Quoted 11 lines · Eamon Walsh
Quoted 9 lines · Christopher J. PeBenito

I ran into an interesting denial:

avc: denied { setattr setattr } for request=X11:SetSelectionOwner comm=dbus-launch selection=_DBUS_SESSION_BUS_SELECTION_root_3c39a16f05862d57c3d6ef0047356754 scontext=root:staff_r:staff_t tcontext=system_u:object_r:xselection_t
tclass=x_selection

Quoted 9 lines
Quoted 5 lines

Other than the double setattr in the permissions, trying to label this selection for anything but the default doesn't seem possible. It seems that this should be type_transitioned, but it didn't seem to work.

Whoops, I know why the double setattr is there. I'll get that fixed, ignore that for now.

We probably need to have wildcarding in the X label support, like the way filenames work. Do you agree?

Quoted 9 lines

This is the role's session bus, not the system bus, so the preference would be to have a type_transition so the selection would be staff_dbus_xselection_t. I don't see how we could get this behavior in x_contexts except by putting in entries for all of the users, which would be suboptimal. Especially since in this case where I logged in as root/staff_r; I could also log in as root/sysadm_r and then in that case we have a problem since the label would be wrong in one of those cases.

Two thoughts:

1. Do this through D-BUS not X, by modifying the D-BUS daemon to set the selection create context when it creates these selections.

or better yet:

2. Fix D-BUS to provide some other way for people to find out the name of the session bus (if that's what in fact this is for, which I'm still unclear on). Like maybe through a D-BUS service.

Signature · 8 lines
Eamon Walsh <[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.