selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* secilc genfscon parsing error
@ 2022-11-23 15:53 Matthew Sheets
  2022-11-23 16:15 ` James Carter
  2022-11-23 18:10 ` Dominick Grift
  0 siblings, 2 replies; 6+ messages in thread
From: Matthew Sheets @ 2022-11-23 15:53 UTC (permalink / raw)
  To: SELinux

Hi,

I am seeing a parsing error from secilc when trying to compile the 
following line:
(genfscon sysfs "/zap" file (system_u object_r foo ((s0) (s0))))

But according to the documentation here:
https://github.com/SELinuxProject/selinux/blob/master/secilc/docs/cil_file_labeling_statements.md#genfscon
I believe this should be a valid line.

The compiler error given is:
Invalid syntax
Bad genfscon declaration at out.cil:129
Failed to build AST
Failed to compile cildb: -1

If I remove the file keyword everything compiles correctly.

Other interesting points of data:

In ref policy there is the following line in selinux.te
genfscon selinuxfs /booleans/ -- gen_context(system_u:object_r:boolean_t,s0)

When compiling this to cil with checkpolicy the following line is produced:
(genfscon selinuxfs "/booleans/" (system_u object_r boolean_t (systemlow 
systemlow)))
Which has no reference to the optional file_type field.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-23 18:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 15:53 secilc genfscon parsing error Matthew Sheets
2022-11-23 16:15 ` James Carter
2022-11-23 17:06   ` Matthew Sheets
2022-11-23 18:10 ` Dominick Grift
2022-11-23 18:13   ` Dominick Grift
2022-11-23 18:29     ` Matthew Sheets

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).