Description of problem: I get mdadm denials when events happen on on array: Jul 27 16:12:28 vault kernel: md: md1 stopped. Jul 27 16:12:28 vault kernel: md: bind<sdb2> Jul 27 16:12:28 vault kernel: md: bind<sda2> Jul 27 16:12:28 vault kernel: md: kicking non-fresh sdb2 from array! Jul 27 16:12:28 vault kernel: md: unbind<sdb2> Jul 27 16:12:28 vault kernel: md: export_rdev(sdb2) Jul 27 16:12:28 vault kernel: raid1: raid set md1 active with 1 out of 2 mirrors Jul 27 16:12:30 vault kernel: md: md0 stopped. Jul 27 16:12:30 vault kernel: md: bind<sdb1> Jul 27 16:12:30 vault kernel: md: bind<sda1> Jul 27 16:12:30 vault kernel: md: kicking non-fresh sdb1 from array! Jul 27 16:12:30 vault kernel: md: unbind<sdb1> Jul 27 16:12:30 vault kernel: md: export_rdev(sdb1) Jul 27 16:12:30 vault kernel: raid1: raid set md0 active with 1 out of 2 mirrors Jul 27 16:12:30 vault kernel: EXT3 FS on md0, internal journal Jul 27 16:12:31 vault kernel: audit(1185574336.897:4): avc: denied { getattr } for pid=1975 comm="sh" name="root" dev=dm-0 ino=98305 scontext=system_u:system_r:mdadm_t:s0 tcontext=root:object_r:user_home_dir_t:s0 tclass=dir Jul 27 16:12:31 vault kernel: audit(1185574336.897:5): avc: denied { search } for pid=1975 comm="sh" name="root" dev=dm-0 ino=98305 scontext=system_u:system_r:mdadm_t:s0 tcontext=root:object_r:user_home_dir_t:s0 tclass=dir Jul 27 16:12:31 vault kernel: audit(1185574337.896:6): avc: denied { getattr } for pid=2039 comm="sh" name="root" dev=dm-0 ino=98305 scontext=system_u:system_r:mdadm_t:s0 tcontext=root:object_r:user_home_dir_t:s0 tclass=dir Jul 27 16:12:31 vault kernel: audit(1185574337.896:7): avc: denied { search } for pid=2039 comm="sh" name="root" dev=dm-0 ino=98305 scontext=system_u:system_r:mdadm_t:s0 tcontext=root:object_r:user_home_dir_t:s0 tclass=dir Version-Release number of selected component (if applicable): selinux-policy-2.6.4-28.fc7 mdadm-2.6.2-4.fc7
Did you restart a service while sitting in /root? Any idea why mdadm would be searching this directory?
This isn't a service restarting, this is just mdadm responding to array events. My thought would be that it might come when sending mail to root, which it does with a popen("/usr/lib/sendmail -t","w"). Mail is successfully sent though. Looks like it's actually a shell script that is running to generate the errors. CC'ing Doug Ledford to see if he has any ideas.
I think Daniel's question was about whether or not the running mdadm had been started from something other than initial bootup. The reason isn't because you are restarting the service now, but because if it was last started in a directory other than /, then it gets errors reading then the shell that gets spawned to start sendmail gets these errors as it is looking for the normal .bash_profile and .bash_rc files. I should be able to modify mdadm so that if it is started in a directory other than / that it cd's into / in order to stop these.
Well, mdmonitor is being started in the normal way via initscripts.
We can just dontaudit the call to remove the avc.
Fixed in selinux-policy-2.6.4-30