Skip to contentSkip to conversation

trivial logging bug

DISCUSSION Russell Coker 2 participants 4 messages Sep 30, 2002 – Oct 1, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

avc: denied { rmdir } for pid=9631 exe=/bin/rm path=/rjc/.ssh/old (deleted) dev=03:07 ino=3406 scontext=rjc:user_r:user_t tcontext=system_u:object_r:user_home_ssh_t tclass=dir

The above is from an rmdir operation. It seems that the dentry gets updated with the new name BEFORE the operation is permitted so we get (deleted) in the log message which is confusing.

I think that perhaps the logging code should be changed to remove the last 10 characters of the file name.

However maybe it would be more correct in terms of code operation to have the check earlier? (I don't know I haven't looked at the code in question).

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.
#1 lore raw
Quoted 8 lines · Russell Coker

avc: denied { rmdir } for pid=9631 exe=/bin/rm path=/rjc/.ssh/old (deleted) dev=03:07 ino=3406 scontext=rjc:user_r:user_t tcontext=system_u:object_r:user_home_ssh_t tclass=dir

The above is from an rmdir operation. It seems that the dentry gets updated with the new name BEFORE the operation is permitted so we get (deleted) in the log message which is confusing.

Quoted 5 lines

I think that perhaps the logging code should be changed to remove the last 10 characters of the file name.

However maybe it would be more correct in terms of code operation to have the check earlier? (I don't know I haven't looked at the code in question).

This behavior is due to the security_ops->inode_rmdir hook being called after the d_unhash on the dentry in vfs_rmdir, so the dentry appears "deleted" to the pathname generation code. To fix, we would need to move up the hook call in the LSM patch. Other than potentially confusing output, I don't think that it is a real concern.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
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.

#2 lore raw
Quoted 6 lines · Stephen Smalley

On Mon, 30 Sep 2002, Russell Coker wrote:
This behavior is due to the security_ops->inode_rmdir hook being called after the d_unhash on the dentry in vfs_rmdir, so the dentry appears "deleted" to the pathname generation code. To fix, we would need to move up the hook call in the LSM patch. Other than potentially confusing output, I don't think that it is a real concern.

OK, well just finding and removing the "(deleted)" string before displaying the message will give a good result for the users...

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.
#3 lore raw
Quoted 10 lines · Russell Coker
Quoted 6 lines · Stephen Smalley

On Mon, 30 Sep 2002, Russell Coker wrote:
This behavior is due to the security_ops->inode_rmdir hook being called after the d_unhash on the dentry in vfs_rmdir, so the dentry appears "deleted" to the pathname generation code. To fix, we would need to move up the hook call in the LSM patch. Other than potentially confusing output, I don't think that it is a real concern.

OK, well just finding and removing the "(deleted)" string before displaying the message will give a good result for the users...

No, I would expect us to submit a change to the LSM patch to move the hook call prior to the d_unhash. I was simply noting that it isn't a security issue, so we don't need an immediate fix.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
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.