can't start X window in enforce mode
Hi, I have eliminated all the denied messages in permissive mode. But when I change to the enforce mode I can't start X window now.The error message is below:
-----------------------------------------------------------------------------------------
...............
(EE) NV(0): Cannot open /dev/mem
................
Fatal server error:
xf86MapVidMem: failed to open /dev/mem (Permission denied)
................
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
-----------------------------------------------------------------------------------------
Why the system didn't display the denied message if the opration violate the policy? How should I configure my policy in order to start the X window? Thanks!
Quoted 3 lines · lky
-------------- Why the system didn't display the denied message if the opration violate the policy? How should I configure my policy in order to start the X window? Thanks!
# memory_device_t access is needed if not using the frame buffer dontaudit $1_xserver_t memory_device_t:chr_file read;
The above is the relevant section of policy in macros/program/xserver_macros.te. The X server tries to access /dev/mem even if it doesn't need to. Change the dontaudit rule to an allow for rw_file_perms and it should work.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.
Quoted 7 lines · On Monday, October 13, 2003 6:11 AM,Russell Coker wrote:
# memory_device_t access is needed if not using the frame buffer dontaudit $1_xserver_t memory_device_t:chr_file read;The above is the relevant section of policy in macros/program/xserver_macros.te. The X server tries to access
/dev/memeven if it doesn't need to. Change the dontaudit rule to an allow forrw_file_permsand it should work.
Absolutely right! It really works,Thanks a lot!
--
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.
I had both problems. I added the dontaudit memory devices as mentioned in the file macros/program/xserver_macros.te.
I have the second problem and have not yet solved it. Nothing is logged and I cannot figure out what is wrong.
BTW - on my system /dev/tty0 is the same file as dev/console (both 4,0). The man page indicates that it should be this way. I tried labeling /dev/tty0 as console_device_t (like /dev/console) but that did not help.
michael
Quoted 13 lines · lky
Hi, I have eliminated all the denied messages in permissive mode. But when I change to the enforce mode I can't start X window now.The error message is below:
-----------------------------------------------------------------------------------------
...............
(EE) NV(0): Cannot open/dev/mem
................
Fatal server error:
xf86MapVidMem: failed to open/dev/mem(Permission denied)
................
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
-----------------------------------------------------------------------------------------
Why the system didn't display the denied message if the opration violate the policy? How should I configure my policy in order to start the X window? Thanks!
Signature · 9 lines
---- ---- ---- Michael Reilly [email protected] Cisco Systems, Santa Cruz, CA -- 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.
Quoted 5 lines · Michael Reilly
I had both problems. I added the dontaudit memory devices as mentioned in the file macros/program/xserver_macros.te.
I have the second problem and have not yet solved it. Nothing is logged and I cannot figure out what is wrong.
Try doing
grep -v dontaudit policy.conf > new-policy
mv new-policy policy.conf
Then load the policy and see what happens.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.
Quoted 4 lines · Russell Coker
Quoted 3 lines · Michael Reilly
I had both problems. I added the dontaudit memory devices as mentioned in the file macros/program/xserver_macros.te.
Quoted 8 lines
Quoted 2 lines
I have the second problem and have not yet solved it. Nothing is logged and I cannot figure out what is wrong.
Try doing
grep -v dontaudit policy.conf > new-policy
mv new-policy policy.confThen load the policy and see what happens.
There should likely be a policy Makefile target to generate and load a policy that does not suppress any auditing.
Signature · 8 lines
Stephen Smalley <[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.
I agree :-)
I did find the problem - the X server needed DAC_OVERRIDE. This was logged as soon as I removed the dontaudit's
michael
Quoted 20 lines · On 14 Oct 2003 11:00:47 -0400 Stephen Smalley <[email protected]> wrote:
Quoted 4 lines · Russell Coker
Quoted 3 lines · Michael Reilly
I had both problems. I added the dontaudit memory devices as mentioned in the file macros/program/xserver_macros.te.
Quoted 8 lines
Quoted 2 lines
I have the second problem and have not yet solved it. Nothing is logged and I cannot figure out what is wrong.
Try doing
grep -v dontaudit policy.conf > new-policy
mv new-policy policy.confThen load the policy and see what happens.
There should likely be a policy
Makefiletarget to generate and load a policy that does not suppress any auditing.Signature · 2 lines
Stephen Smalley <[email protected]> National Security Agency
Signature · 8 lines
---- ---- ---- Michael Reilly [email protected] Cisco Systems, Santa Cruz, CA -- 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.
Quoted 2 lines · Michael Reilly
I did find the problem - the X server needed
DAC_OVERRIDE. This was logged as soon as I removed the dontaudit's
Why did it need DAC_OVERRIDE?
Why not DAC_READ_SEARCH?
Signature · 11 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.
Didn't try DAC_READ_SEARCH yet (that is part of this evenings project) The dontaudit line was for DAC_OVERRIDE so I just commented out that line and added DAC_OVERRIDE to the other capabilities.
michael
Quoted 13 lines · On Wed, 15 Oct 2003 10:18:09 +1000 Russell Coker <[email protected]> wrote:
Quoted 2 lines · Michael Reilly
I did find the problem - the X server needed
DAC_OVERRIDE. This was logged as soon as I removed the dontaudit'sWhy did it need
DAC_OVERRIDE?Why not
DAC_READ_SEARCH?Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
Signature · 9 lines
---- ---- ---- Michael Reilly [email protected] Cisco Systems, Santa Cruz, CA -- 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.
Tried last night with DAC_READ_SEARCH instead of DAC_OVERRIDE - X server no go. Same error about /dev/tty0 not being found.
If it matters I am running the VESA frame buffer X server. The HW vendor used an ATI video chip in a non-standard way to integrate a flat panel display so the ATI server doesn't find the flat panel.
michael
Quoted 13 lines · On Wed, 15 Oct 2003 10:18:09 +1000 Russell Coker <[email protected]> wrote:
Quoted 2 lines · Michael Reilly
I did find the problem - the X server needed
DAC_OVERRIDE. This was logged as soon as I removed the dontaudit'sWhy did it need
DAC_OVERRIDE?Why not
DAC_READ_SEARCH?Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
Signature · 9 lines
---- ---- ---- Michael Reilly [email protected] Cisco Systems, Santa Cruz, CA -- 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.
Quoted 6 lines · Michael Reilly
Tried last night with
DAC_READ_SEARCHinstead ofDAC_OVERRIDE- X server no go. Same error about/dev/tty0not being found.If it matters I am running the VESA frame buffer X server. The HW vendor used an ATI video chip in a non-standard way to integrate a flat panel display so the ATI server doesn't find the flat panel.
The VESA frame buffer should not be a problem, it's what I use.
There may be some issues related to the differences between Debian and Red Hat X servers, I have not yet managed to get X working on a Red Hat machine due to kernel issues and lack of trying.
In any case I've changed my policy to allow dac_override. It doesn't make any sense to allow setuid and setgid but deny dac_override.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.