Bug 222815 - webalizer attempts getattr /
Summary: webalizer attempts getattr /
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: webalizer
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-16 11:58 UTC by k3dzngrp8w2xtc9
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-02-26 09:34:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output of 'strace -fF ./00webalizer' in /etc/cron.daily as root (279.46 KB, text/plain)
2007-01-30 03:54 UTC, k3dzngrp8w2xtc9
no flags Details

Description k3dzngrp8w2xtc9 2007-01-16 11:58:04 UTC
Description of problem:
avc: denied { getattr } for comm="pam_console_app" dev=dm-0 name="/" pid=318276
scontext=system_u:system_r:pam_console_t:s0-s0:c0.c1023 tclass=filesystem
tcontext=system_u:object_r:fs_t:s0 

Version-Release number of selected component (if applicable):
pam-0.99.6.2-3.9.fc6

Comment 1 Tomas Mraz 2007-01-16 12:13:51 UTC
what happens if you do 'restorecon /'?

What is printed by ls -Zd / before and after the restorecon?


Comment 2 k3dzngrp8w2xtc9 2007-01-16 12:23:44 UTC
# ls -Zd /
drwxr-xr-x  root root system_u:object_r:root_t         /
# restorecon /
# ls -Zd /
drwxr-xr-x  root root system_u:object_r:root_t         /


Comment 3 Tomas Mraz 2007-01-16 12:43:40 UTC
Strange that / has correct system_u:object_r:root_t but in the AVC it shows
system_u:object_r:fs_t.

I don't see this problem here.

pam_console_apply must be able to getattr on '/' so that's rather a policy or
labelling issue of some kind.


Comment 4 k3dzngrp8w2xtc9 2007-01-17 10:43:46 UTC

*** This bug has been marked as a duplicate of 222806 ***

Comment 5 Tomas Mraz 2007-01-26 20:44:20 UTC
The '/' in the AVC is not the real root but a root of the filesystem on dev dm-0.

What is the content of the /etc/fstab and what 'ls -l /dev/mapper' prints?


Comment 6 k3dzngrp8w2xtc9 2007-01-26 22:36:55 UTC
$ cat /etc/fstab 
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
##/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
# MY:
/swap                   swap                    swap    defaults        0 0

$ ls -l /dev/mapper
total 0
crw------- 1 root root  10, 63 Jan 25 15:49 control
brw-rw---- 1 root disk 253,  0 Jan 25 15:50 VolGroup00-LogVol00
brw-rw---- 1 root disk 253,  1 Jan 25 15:49 VolGroup00-LogVol01


Comment 7 k3dzngrp8w2xtc9 2007-01-26 22:47:40 UTC
You are right, of course, but the filesystem on dm-0 *is* the one mounted on /

Comment 8 Tomas Mraz 2007-01-29 19:42:00 UTC
Ah yes, that's because it is not a label of the root dir on the filesystem but
of the filesystem object itself. So the bug 222806 can actually be closed as
NOTABUG.

I am reopening this one. Can you try to run pam_console_apply manually from a 
root account with and without '-r' option? Do the AVCs appear? If yes, can you
please strace pam_console_apply and attach the log here?


Comment 9 k3dzngrp8w2xtc9 2007-01-30 03:49:00 UTC
I have run 'pam_console_apply' and 'pam_console_apply -r' from a root prompt
opened with 'su -'. No AVCs.

I only got the AVC in regard to pam_console_apply 2 times. But from webalizer:
142 times. Webalizer is a daily cronjob, but sometimes there is no AVC for days
(the cronjob does get run)... So I will try running pam_console_apply more...

In the meantime I tried running './00webalizer' in /etc/cron.daily and got the
AVC that is in bug 222806 .



Comment 10 k3dzngrp8w2xtc9 2007-01-30 03:54:09 UTC
Created attachment 146883 [details]
Output of 'strace -fF ./00webalizer' in /etc/cron.daily as root

Comment 11 Joe Orton 2007-02-06 15:19:27 UTC
What exactly is that strace output supposed to show?  What is webalizer doing wrong?

Comment 12 Tomas Mraz 2007-02-06 15:37:11 UTC
Well this strace doesn't seem to do anything suspicious to me. We would need a
strace when the AVC happen.


Comment 13 k3dzngrp8w2xtc9 2007-02-06 16:23:03 UTC
That straced webalizer produced an avc.

avc: denied { getattr } for comm="webalizer" dev=dm-0 name="/" pid=18041
scontext=user_u:system_r:webalizer_t:s0 tclass=filesystem
tcontext=system_u:object_r:fs_t:s0 

The PID matches.


Comment 14 k3dzngrp8w2xtc9 2007-02-08 03:19:50 UTC
Sorry but what syscall does "getattr" correspond to? stat and variants?

I can not reproduce this with pam_console_apply even after policy packge upgrade
(which seemed to trigger this "issue" with setroubleshootd and webalizer) it
runs without avcs... I tried by downgrading to an old policy and upgrading again.

Comment 15 k3dzngrp8w2xtc9 2007-02-26 08:40:06 UTC
I cannot reproduce this issue any more.

Comment 16 Tomas Mraz 2007-02-26 09:34:13 UTC
perhaps this was resolved with some later policy upgrade


Comment 17 k3dzngrp8w2xtc9 2007-02-27 08:38:18 UTC
And just the following day, I got this again... Now it's tzdata

avc: denied { getattr } for comm="tzdata-update" dev=dm-0 name="/" pid=9902
scontext=system_u:system_r:tzdata_t:s0 tclass=filesystem
tcontext=system_u:object_r:fs_t:s0 

Comment 18 Tomas Mraz 2007-02-27 08:48:53 UTC
This really looks like some leaked descriptor. But which process leaks it...



Note You need to log in before you can comment on or make changes to this bug.