All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: "R. Steven Rainwater" <srainwater@ncc.com>
Cc: gyurdiev@redhat.com, SELinux@tycho.nsa.gov
Subject: Re: dumb newbie questions
Date: Mon, 20 Jun 2005 14:18:48 -0400	[thread overview]
Message-ID: <42B70888.2070703@redhat.com> (raw)
In-Reply-To: <1119290793.30000.115.camel@rodan.ncc.com>

R. Steven Rainwater wrote:

>On Mon, 2005-06-20 at 11:59, Ivan Gyurdiev wrote:
>  
>
>>Are you sure the denial you got when running your script
>>as root from a shell said: scontext=...httpd.. ? It would
>>help if you could double check that.
>>    
>>
>
>No problem. Here's the whole thing with a little more detail.
>
>The perl script "test.pl":
>
>#!/usr/bin/perl
>print "Content-type: text/html\n\n";
>print "Hello!\n"
>
>Experiment #1:
>
>The script is located in /var/www/cgi-bin:
>
>ls -alZ shows:
>
>-rwxrwxr-x apache:apache root:object_r:httpd_sys_content_t test.pl
>
>Hit through apache I get "Hello!" in my browser as expected.
>
>Executed locally from the command line as Root, the script silently
>fails (produces no output). Four errors appear in the message log:
>
>Jun 20 12:56:22 orac2 kernel: audit(1119290182.484:0): avc:  denied  {
>read write } for  pid=20536 comm=test.pl name=0 dev=devpts ino=2
>scontext=root:system_r:httpd_sys_script_t
>tcontext=root:object_r:devpts_t tclass=chr_file
>
>Jun 20 12:56:22 orac2 kernel: audit(1119290182.484:0): avc:  denied  {
>read write } for  pid=20536 comm=test.pl path=/dev/pts/0 dev=devpts
>ino=2 scontext=root:system_r:httpd_sys_script_t
>tcontext=root:object_r:devpts_t tclass=chr_file
>
>Jun 20 12:56:22 orac2 kernel: audit(1119290182.485:0): avc:  denied  {
>read write } for  pid=20536 comm=test.pl path=/dev/pts/0 dev=devpts
>ino=2 scontext=root:system_r:httpd_sys_script_t
>tcontext=root:object_r:devpts_t tclass=chr_file
>
>Jun 20 12:56:22 orac2 kernel: audit(1119290182.486:0): avc:  denied  {
>read write } for  pid=20536 comm=test.pl path=/dev/pts/0 dev=devpts
>ino=2 scontext=root:system_r:httpd_sys_script_t
>tcontext=root:object_r:devpts_t tclass=chr_file
>
>Executed locally by user 'rsr', the script also fails and produces four
>identical error messages except that scontext now starts with 'user_u'
>instead of 'root' in each error.
>
>
>Experiment #2:
>
>I used 'cp' to copy the file to /home/rsr
>
>ls -alZ shows:
>
>-rwxrwxr-x apache:apache root:object_r:user_home_t test.pl
>
>Executed locally from the command line as user 'rsr', the script runs as
>expected, printing "Hello!".
>
>Executed locally from the command line as root, the script runs as
>expected, printing "Hello!".
>
>No errors appear in the messages log when run from /home/rsr.
>
>Let me know if I left anything useful out...
>
>-Steve
>
>  
>
Ok there is a bug in policy.

Basically we have a

domain_auto_trans(sysadm_t, httpd_sys_script_exec_t, httpd_sys_script_t)

I have been ifdefing these out for targeted policy, but I am wondering 
if we want these for strict policy either.

Fix will be in selinux-policy-targeted-1.23.18-16

Dan

-- 



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2005-06-20 18:18 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-17 20:01 SELinux Integrated Logging Tool Brandon Pollet
2005-06-17 23:43 ` James Morris
2005-06-18 15:39 ` Steve G
2005-06-18 23:38   ` dumb newbie questions R. Steven Rainwater
2005-06-19  6:45     ` Ivan Gyurdiev
2005-06-19 16:40       ` Casey Schaufler
2005-06-19 19:51         ` Ivan Gyurdiev
2005-06-19 20:14           ` Casey Schaufler
2005-06-19 20:57             ` Ivan Gyurdiev
2005-06-19 21:31               ` Casey Schaufler
2005-06-19 22:10                 ` Luke Kenneth Casson Leighton
2005-06-20  0:28                   ` Casey Schaufler
2005-06-19 22:13             ` Luke Kenneth Casson Leighton
2005-06-20  0:16               ` Casey Schaufler
2005-06-20 19:21                 ` Luke Kenneth Casson Leighton
2005-06-20 20:41                   ` Casey Schaufler
2005-06-20 21:01                     ` Valdis.Kletnieks
2005-06-20 21:36                       ` Casey Schaufler
2005-06-22  9:48                         ` Christopher Warner
2005-06-19 20:41           ` Ivan Gyurdiev
2005-06-20  3:34             ` R. Steven Rainwater
2005-06-20  4:45               ` Valdis.Kletnieks
2005-06-20 14:45                 ` R. Steven Rainwater
2005-06-20 15:14                   ` Ivan Gyurdiev
2005-06-20 15:29                     ` R. Steven Rainwater
2005-06-20 15:44                       ` Ivan Gyurdiev
2005-06-20 16:40                         ` R. Steven Rainwater
2005-06-20 16:59                           ` Ivan Gyurdiev
2005-06-20 17:35                             ` Karl MacMillan
2005-06-20 18:06                             ` R. Steven Rainwater
2005-06-20 18:18                               ` Daniel J Walsh [this message]
2005-06-24  6:22                                 ` Russell Coker
2005-06-20 18:06                             ` Daniel J Walsh
2005-06-20 18:57                           ` Luke Kenneth Casson Leighton
2005-06-20 15:56                       ` Stephen Smalley
2005-06-20 19:05                       ` Luke Kenneth Casson Leighton
2005-06-20 16:28                     ` Stephen Smalley
2005-06-20 18:49               ` Luke Kenneth Casson Leighton
2005-06-19 22:17           ` Luke Kenneth Casson Leighton
2005-06-20  4:11             ` Ivan Gyurdiev
2005-06-20 13:12     ` Trevor Vaughan
2005-06-20 15:21       ` R. Steven Rainwater
2005-06-20 15:40         ` Ivan Gyurdiev
2005-06-20 16:20         ` Stephen Smalley
2005-06-30 22:11     ` cgiemail and senmail policy R. Steven Rainwater
2005-07-03 14:21       ` Daniel J Walsh

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=42B70888.2070703@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=SELinux@tycho.nsa.gov \
    --cc=gyurdiev@redhat.com \
    --cc=srainwater@ncc.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.