All of lore.kernel.org
 help / color / mirror / Atom feed
* Semodule accepts bad modules every other time
@ 2020-05-18  9:40 Topi Miettinen
  2020-05-18 13:55 ` Stephen Smalley
  0 siblings, 1 reply; 4+ messages in thread
From: Topi Miettinen @ 2020-05-18  9:40 UTC (permalink / raw)
  To: SElinux list

Hi,

I have a module, which can be compiled without problems but it can still 
generate errors during load. However, every other time the load succeeds.

Here's the example:
# cat foo.te
module foo 1.0;

type file_type;

require {
         type user_t; # dummy require statement to keep checkmodule happy
}
# make
Compiling default foo module
Creating default foo.pp policy package
rm tmp/foo.mod.fc tmp/foo.mod
# make QUIET=n load
Loading default modules: foo
/usr/sbin/semodule -i foo.pp
Re-declaration of type file_type
Failed to create node
Bad type declaration at /var/lib/selinux/default/tmp/modules/400/foo/cil:1
/usr/sbin/semodule:  Failed!
make: *** [/usr/share/selinux/devel/include/Makefile:148: tmp/loaded] 
Error 1
# make QUIET=n load
Loading default modules: foo
/usr/sbin/semodule -i foo.pp
(no error)

Running semodule directly:
# semodule -i foo.pp
Re-declaration of type file_type
Failed to create node
Bad type declaration at /var/lib/selinux/default/tmp/modules/400/foo/cil:1
semodule:  Failed!
# semodule -i foo.pp
# semodule -i foo.pp
Re-declaration of type file_type
Failed to create node
Bad type declaration at /var/lib/selinux/default/tmp/modules/400/foo/cil:1
semodule:  Failed!
# semodule -i foo.pp

Maybe the failing transaction is not reverted properly and then the 
failed module changes the system somehow? Some problem with detecting 
redeclarations?

-Topi

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

end of thread, other threads:[~2020-05-19  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18  9:40 Semodule accepts bad modules every other time Topi Miettinen
2020-05-18 13:55 ` Stephen Smalley
2020-05-18 14:41   ` James Carter
2020-05-19  9:32     ` Topi Miettinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.