Selinux checkpolicy parse error
Hey guys/gals,
I'm applying Selinux (1.22) to a native distro built inhouse for the company that I work for.
I've lovingly applied the required patches to the relevant programs that require Selinux (from fedora without subsequent fedora dependency where found, so it works with inhouse distro). Now I am trying to configure the default policy and am not sure as to why it's not working. It seems that there is something wrong with checkpolicy and parsing. I've tried to search the mailing list but the interface via nsa.gov is kludgy and ineffective for searching the archive. There seems to have been a resolution regarding checkpolicy but the communication between the two parties was private or missing from the list. Should there be a better interface to previous archived messaging I'd like to know.
Here is the respective error:
-bash-3.00# make/usr/bin/checkpolicy -o policy.19 policy.conf /usr/bin/checkpolicy: loading policy configuration from policy.conf types/file.te:92:ERROR 'syntax error' at token ':' on line 3329:
type shadow_t, file_type, secure_file_type;
allow auth shadow_t: file { getattr read }; /usr/bin/checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.19] Error 1
The line from policy.conf:
allow auth shadow_t : file { getattr read };
Syntax seems to be correct; I'm currently using flex version 2.5.4. Kernel version 2.6.11.5, i'm patched up with everything from cvs.
Essentially I would just like to create a simple policy to get things working. I'd try to start with something simple but the way the policy is intertwined with context's etc would require me to basically start rewriting from there and I'm not sufficiently experienced enough with Selinux to do so yet. If there is no way to do so beyond that I am willing to put the required effort and time in. However, I suspect there is a more succinct and quicker way to get up and started.
Any guidance would be greatly appreciated.
Thanks,
Christopher Warner
--
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.
Quoted 6 lines · Christopher Warner
I've tried
to search the mailing list but the interface via nsa.gov is kludgy and ineffective for searching the archive. There seems to have been a resolution regarding checkpolicy but the communication between the two parties was private or missing from the list. Should there be a better interface to previous archived messaging I'd like to know.
There is an unofficial mailing list archive at
http://marc.theaimsgroup.com/?l=selinux that is much more readily searchable. Google can also be your friend ;) You can also grab the list archives in raw text format via majordomo if you want.
Quoted 11 lines
Here is the respective error:
-bash-3.00# make
/usr/bin/checkpolicy-o policy.19 policy.conf/usr/bin/checkpolicy: loading policy configuration from policy.conf types/file.te:92:ERROR 'syntax error' at token ':' on line 3329:
typeshadow_t,file_type,secure_file_type;
allow authshadow_t: file { getattr read };/usr/bin/checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.19] Error 1
Quoted 5 lines
The line from policy.conf:
allow authshadow_t: file { getattr read };Syntax seems to be correct; I'm currently using flex version 2.5.4. Kernel version 2.6.11.5, i'm patched up with everything from cvs.
This sounds familiar, looks like the thread starting at
http://marc.theaimsgroup.com/?l=selinux&m=109338670806273&w=2
As far as I could see, it was a bug in the scanner produced by the person's version of flex, not a bug in the checkpolicy sources. And I couldn't reproduce it on Fedora.
Quoted 7 lines
Essentially I would just like to create a simple policy to get things working. I'd try to start with something simple but the way the policy is intertwined with context's etc would require me to basically start rewriting from there and I'm not sufficiently experienced enough with Selinux to do so yet. If there is no way to do so beyond that I am willing to put the required effort and time in. However, I suspect there is a more succinct and quicker way to get up and started.
selinux-policy-targeted from Fedora is a simpler starting point if you want to just confine specific daemons.
Signature · 8 lines
Stephen Smalley <[email protected]> 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.
Quoted 5 lines · Stephen Smalley
This sounds familiar, looks like the thread starting at
http://marc.theaimsgroup.com/?l=selinux&m=109338670806273&w=2
As far as I could see, it was a bug in the scanner produced by the person's version of flex, not a bug in the checkpolicy sources. And I couldn't reproduce it on Fedora.
It seems that flex is the problem. Somewhere in the flex series of patches for redhat/fedora lies a fix for this problem (this in version 2.5.4). Going through the spec file doesn't necessarily give any direct info, changelogs are sparse. I'll try to find the the right combo of patch and update here with whatever works.. Thanks again for the help.
Christopher Warner
--
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.
Quoted 7 lines
It seems that flex is the problem. Somewhere in the flex series of patches for redhat/fedora lies a fix for this problem (this in version 2.5.4). Going through the spec file doesn't necessarily give any direct info, changelogs are sparse. I'll try to find the the right combo of patch and update here with whatever works.. Thanks again for the help.
Christopher Warner
It seems that the lex.yy.c that is generated by other versions of flex (non-patched, I'd assume) cause the parsing errors. What happens is that when lex.yy.c is generated by a different version of flex ie:
2.5.31/2.5.4 vanilla or whatever. It causes the bug above (grin). I'd delve into this deeper but i'm 2 days into this and want to move on.
lex.yy.c isn't significantly different but it is different enough to cause the respective error.
Hope this helps someone.
Christopher Warner
--
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.
Quoted 8 lines · Christopher Warner
It seems that the
lex.yy.cthat is generated by other versions of flex (non-patched, I'd assume) cause the parsing errors. What happens is that whenlex.yy.cis generated by a different version of flex ie:
2.5.31/2.5.4 vanilla or whatever. It causes the bug above (grin). I'd delve into this deeper but i'm 2 days into this and want to move on.
lex.yy.cisn't significantly different but it is different enough to cause the respective error.
Looks like Fedora has several patches that the skeleton file used to generate lex.yy.c.
Signature · 8 lines
Stephen Smalley <[email protected]> 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.