]> git.baikalelectronics.ru Git - kernel.git/commit
bsdacct: switch credentials for writing to the accounting file
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 20 Aug 2009 21:39:52 +0000 (14:39 -0700)
committerJames Morris <jmorris@namei.org>
Mon, 24 Aug 2009 01:33:40 +0000 (11:33 +1000)
commited8c8209f8c80c7bd27a96f3395f23398534866f
tree0d2f864e4673df4abf994e222616651409a91c0a
parent08d8d9f0c1d495520459c61f5b5ba005319dd307
bsdacct: switch credentials for writing to the accounting file

When process accounting is enabled, every exiting process writes a log to
the account file.  In addition, every once in a while one of the exiting
processes checks whether there's enough free space for the log.

SELinux policy may or may not allow the exiting process to stat the fs.
So unsuspecting processes start generating AVC denials just because
someone enabled process accounting.

For these filesystem operations, the exiting process's credentials should
be temporarily switched to that of the process which enabled accounting,
because it's really that process which wanted to have the accounting
information logged.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Morris <jmorris@namei.org>
kernel/acct.c