Bug 672990

Summary: running MLS policy you can write-down using terminal copy&paste
Product: Red Hat Enterprise Linux 6 Reporter: Ted X Toth <txtoth>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0CC: dwalsh
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-27 21:07:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ted X Toth 2011-01-26 22:59:50 UTC
Description of problem: Using copy&paste on gnome-terminals running at different levels you can write-down i.e. paste from a higher level terminal to a lower level terminal.


Version-Release number of selected component (if applicable):
selinux-policy-mls-3.7.19-54
mcstrans-0.3.1-4

How reproducible:


Steps to Reproduce:
1.Using semanage I changed the default login and user to be ranged SystemLow-SystemHigh so that I could newrole to single levels
2.Added user_devpts_t to /etc/selinux/mls/contexts/securetty_types so that a user could run newrole in a gnome-terminal
3.start 2 gnome-terminals
4.in terminal 1 run `newrole -l Secret-Secret`, authenticate, copy text of newrole command using Edit menu Copy
5.in terminal 2 run `newrole -l Unclassified-Unclassified`, authenticate, paste using Edit menu Paste
  
Actual results:
Copied text pasted from Secret window to Unclassified window


Expected results:
Unclassified windows Edit menu Paste should not be active since it should not know that anything is in the clipboard. The clipboard data should be labeled Secret and not accessible to the Unclassified gnome-terminal.

Additional info:

Comment 2 Daniel Walsh 2011-01-27 16:09:40 UTC
Ted lets bring this up for discussion on the list.  I am not sure what the proper control on this would be.  Since you did not launch the terminal with the correct label, the X Session does not know you are running at a different level, so it can not prevent.  After all you cut from a terminal and pasted to a terminal running at the same level.  So I think changing the securetty_types is not allowed.

Comment 3 Ted X Toth 2011-01-27 18:32:56 UTC
You're right. What I should have done was:
newrole -l Secret-Secret -- -c "gnome-terminal --disable-factory"

for instance so that the new window is running at the level specified and then indeed you can't copy&paste to gnome-terminal started similarly but at a different level. You can close this as not a bug. Sorry for the bother.

Comment 4 Daniel Walsh 2011-01-27 21:07:01 UTC
No problem, interesting to think about and glad that it is blocked.