Skip to contentSkip to conversation

promoting printk for FS mounting back from KERN_DEBUG

DISCUSSION Eric Paris 3 participants 5 messages Mar 27, 2007 – Mar 28, 2007 SELinux security module

lore
Share & tools
lore

Eric Paris

author
#0 lore raw

So with my recent printk demotions lots of thing were made KERN_DEBUG from INFO. The whole reason for the patch was the messages in hooks.c were spamming people's logs when they had lots of auto fs mounts coming and going. Relevant code to the discussion below:

303 static char *labeling_behaviors[6] = {

 304         "uses xattr",
 305         "uses transition SIDs",
 306         "uses task SIDs",
 307         "uses genfs_contexts",
 308         "not configured for labeling",
 309         "uses mountpoint labeling",

310 };

655 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) {
656 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
657 sb->s_id, sb->s_type->name);
658 }
659 else {
660 printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
661 sb->s_id, sb->s_type->name,
662 labeling_behaviors[sbsec->behavior-1]);
663 }

I think that marking all of these behaviors as KERN_DEBUG is right except maybe when sbsec->behavior == 5 ("not configured for labeling"). Do we want to warn users that they are mounting a FS we know nothing about? If we do want to promote that message do we want to give more descriptive output so the user knows what to do? Possibly suggest to them to include the FS in their policy or use a context mount? If so any suggestions on wording that message? Maybe we want to still print the same debug but att a new printk just for the behavior == 5 case?

This comes about because as more and more fuse FS's get used we hit more and more FS's which don't have defined labeling behavior in policy.

-Eric

--
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 33 lines · Eric Paris

So with my recent printk demotions lots of thing were made KERN_DEBUG from INFO. The whole reason for the patch was the messages in hooks.c were spamming people's logs when they had lots of auto fs mounts coming and going. Relevant code to the discussion below:

303 static char *labeling_behaviors[6] = {

 304         "uses xattr",
 305         "uses transition SIDs",
 306         "uses task SIDs",
 307         "uses genfs_contexts",
 308         "not configured for labeling",
 309         "uses mountpoint labeling",

310 };

655 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) {
656 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
657 sb->s_id, sb->s_type->name);
658 }
659 else {
660 printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
661 sb->s_id, sb->s_type->name,
662 labeling_behaviors[sbsec->behavior-1]);
663 }

I think that marking all of these behaviors as KERN_DEBUG is right except maybe when sbsec->behavior == 5 ("not configured for labeling"). Do we want to warn users that they are mounting a FS we know nothing about? If we do want to promote that message do we want to give more descriptive output so the user knows what to do? Possibly suggest to them to include the FS in their policy or use a context mount? If so any suggestions on wording that message? Maybe we want to still print the same debug but att a new printk just for the behavior == 5 case?

Quoted 2 lines

This comes about because as more and more fuse FS's get used we hit more and more FS's which don't have defined labeling behavior in policy.

Won't such cases show up indirectly anyway through avc messages on unlabeled_t files?

Signature · 8 lines
Stephen Smalley
National Security Agency


--
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.
author
#2 lore raw
Quoted 34 lines · Stephen Smalley
Quoted 33 lines · Eric Paris

So with my recent printk demotions lots of thing were made KERN_DEBUG from INFO. The whole reason for the patch was the messages in hooks.c were spamming people's logs when they had lots of auto fs mounts coming and going. Relevant code to the discussion below:

303 static char *labeling_behaviors[6] = {

 304         "uses xattr",
 305         "uses transition SIDs",
 306         "uses task SIDs",
 307         "uses genfs_contexts",
 308         "not configured for labeling",
 309         "uses mountpoint labeling",

310 };

655 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) {
656 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
657 sb->s_id, sb->s_type->name);
658 }
659 else {
660 printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
661 sb->s_id, sb->s_type->name,
662 labeling_behaviors[sbsec->behavior-1]);
663 }

I think that marking all of these behaviors as KERN_DEBUG is right except maybe when sbsec->behavior == 5 ("not configured for labeling"). Do we want to warn users that they are mounting a FS we know nothing about? If we do want to promote that message do we want to give more descriptive output so the user knows what to do? Possibly suggest to them to include the FS in their policy or use a context mount? If so any suggestions on wording that message? Maybe we want to still print the same debug but att a new printk just for the behavior == 5 case?

Quoted 5 lines
Quoted 2 lines

This comes about because as more and more fuse FS's get used we hit more and more FS's which don't have defined labeling behavior in policy.

Won't such cases show up indirectly anyway through avc messages on unlabeled_t files?

Yes they will, which is when we finally hear about them. But since we know up front something is wrong wouldn't it be a good idea to point them in the right direction? Very few people are going to see the unlabeled_t denial and know right away what needs to be done to fix it. If we don't think a printk is the right way maybe I could make the one case in question an audit message and get the setroubleshoot gui to make a semi-intelligent comment about it...

-Eric

--
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 4 lines

If we don't think a printk is the right way maybe I could make the one case in question an audit message and get the setroubleshoot gui to make a semi-intelligent comment about it...

No, no, no. Audit is not a dumping ground for messages. It is only for security relavent events and mounting an unlabled file system is only of interest when doing LSPP due to import/export to labeled/unlabeled media. I know we already solved the issue for LSPP.

-Steve

____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

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

#4 lore raw
In reply to Eric Paris
Quoted 41 lines · Eric Paris
Quoted 34 lines · Stephen Smalley
Quoted 33 lines · Eric Paris

So with my recent printk demotions lots of thing were made KERN_DEBUG from INFO. The whole reason for the patch was the messages in hooks.c were spamming people's logs when they had lots of auto fs mounts coming and going. Relevant code to the discussion below:

303 static char *labeling_behaviors[6] = {

 304         "uses xattr",
 305         "uses transition SIDs",
 306         "uses task SIDs",
 307         "uses genfs_contexts",
 308         "not configured for labeling",
 309         "uses mountpoint labeling",

310 };

655 if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors)) {
656 printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
657 sb->s_id, sb->s_type->name);
658 }
659 else {
660 printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
661 sb->s_id, sb->s_type->name,
662 labeling_behaviors[sbsec->behavior-1]);
663 }

I think that marking all of these behaviors as KERN_DEBUG is right except maybe when sbsec->behavior == 5 ("not configured for labeling"). Do we want to warn users that they are mounting a FS we know nothing about? If we do want to promote that message do we want to give more descriptive output so the user knows what to do? Possibly suggest to them to include the FS in their policy or use a context mount? If so any suggestions on wording that message? Maybe we want to still print the same debug but att a new printk just for the behavior == 5 case?

Quoted 5 lines
Quoted 2 lines

This comes about because as more and more fuse FS's get used we hit more and more FS's which don't have defined labeling behavior in policy.

Won't such cases show up indirectly anyway through avc messages on unlabeled_t files?

Quoted 7 lines

Yes they will, which is when we finally hear about them. But since we know up front something is wrong wouldn't it be a good idea to point them in the right direction? Very few people are going to see the unlabeled_t denial and know right away what needs to be done to fix it. If we don't think a printk is the right way maybe I could make the one case in question an audit message and get the setroubleshoot gui to make a semi-intelligent comment about it...

More people are likely to see the unlabeled_t denial due to setroubleshoot, right? We can't rely on users to even think of checking their system logs (at least that seemed to be part of the rationale for setroubleshoot). And we can write a plugin for setroubleshoot that catches such denials, extracts the filesystem information, and proposes a solution. Versus introducing an entirely new message that users won't see and nothing will automatically process.

Signature · 8 lines
Stephen Smalley
National Security Agency


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