All of lore.kernel.org
 help / color / mirror / Atom feed
* problem relabel the file system
@ 2001-05-24  5:12 Ying-Hung Chen
  2001-05-29 13:54 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Ying-Hung Chen @ 2001-05-24  5:12 UTC (permalink / raw)
  To: SELinux@tycho.nsa.gov

Hi All,

	I have installed SELinux on couple of my machines, it usually go
through ok at the first time, but when i try to relabel again for any
reason (i.e. change the policy/file_contexts) I always have some files
that refuse to get relabel again and cause make file to fail.

	I did remove ALL the .../security for all the partitions and did a make
initinstall in the policy (instruction 5 and 7 in the installation
guide) but no luck.

	I noticed on the installation guide, it mentioned:

"Although this invalidates any existing file labels, it does not clear
the persistent SID values in the inodes.  Consequently, some warnings
are likely when the file system is relabeled in step 12.  A program
will be provided in the future to clear the persistent SID values."

does this cause the make relabel to fail since inodes never get clean
up? are there any work arounds?

Thanks,

-Ying

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: problem relabel the file system
  2001-05-24  5:12 problem relabel the file system Ying-Hung Chen
@ 2001-05-29 13:54 ` Stephen Smalley
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2001-05-29 13:54 UTC (permalink / raw)
  To: Ying-Hung Chen; +Cc: SELinux@tycho.nsa.gov


> 	I have installed SELinux on couple of my machines, it usually go
> through ok at the first time, but when i try to relabel again for any
> reason (i.e. change the policy/file_contexts) I always have some files
> that refuse to get relabel again and cause make file to fail.

What exactly is the error that you are seeing?  Are any kernel log
messages being generated by the failure (check the output of
'dmesg' immediately after trying to do a 'make relabel')?  If you
are using a SELinux kernel in enforcing mode, I would guess that
your problem is due to a lack of file transition permissions in the policy
configuration between the relevant types.  The example policy
configuration is only really set up for the initial relabeling.  
File relabeling is controlled by three permissions:
1) The domain must have relabelfrom permission to the old type, and
2) The old type must have transition permission to the new type, and
3) The domain must have relabelto permission to the new type.

For unrestricted type transitions, you could add this rule:
    allow file_type file_type:dir_file_class_set transition;

In this case, the system would no longer control type transitions
but would continue to control what domains can cause such
transitions.

> 	I did remove ALL the .../security for all the partitions and did a make
> initinstall in the policy (instruction 5 and 7 in the installation
> guide) but no luck.

You don't need to remove the old persistent label mappings if
you are simply changing policy/file_contexts.  Removing the old
mappings is only for upgrading to newer versions of SELinux, and
frequently isn't even necessary in that case.

> 	I noticed on the installation guide, it mentioned:
> 
> "Although this invalidates any existing file labels, it does not clear
> the persistent SID values in the inodes.  Consequently, some warnings
> are likely when the file system is relabeled in step 12.  A program
> will be provided in the future to clear the persistent SID values."
> 
> does this cause the make relabel to fail since inodes never get clean
> up? are there any work arounds?

Yes, this can cause a failure if you are running a SELinux kernel in
enforcing mode.  As I mentioned above, you should only do this
when upgrading to a newer version, and you should use a development
kernel in permissive mode to do the initial relabeling to avoid
failures.

--
Stephen D. Smalley, NAI Labs
ssmalley@nai.com






--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2001-05-29 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-24  5:12 problem relabel the file system Ying-Hung Chen
2001-05-29 13:54 ` Stephen Smalley

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.