All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Caplan <dac@tresys.com>
To: Valdis.Kletnieks@vt.edu
Cc: Mark Shakespeare <mshakes@llnl.gov>,
	selinux@tycho.nsa.gov, selinuxdev <selinux-dev@tresys.com>
Subject: Re: Sepcut Relabel problem
Date: Wed, 07 Apr 2004 12:17:42 -0400	[thread overview]
Message-ID: <407429A6.5090606@tresys.com> (raw)
In-Reply-To: <200404071008.i37A8d9U011172@turing-police.cc.vt.edu>

Valdis.Kletnieks@vt.edu wrote:
> On Tue, 06 Apr 2004 16:31:12 PDT, Mark Shakespeare <mshakes@llnl.gov>  said:
> 
>>--============_-1130828223==_ma============
>>Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>>
>>Trying to relabel file system from within Sepcut ( most current version )
>>
>>getting a weird error....
>>
>>
>>couldn't open "/tmp/sepcut-zrqWs8Ew": no such file or directory
>>couldn't open "/tmp/sepcut-zrqWs8Ew": no such file or directory
> 
> 
>>Sepcut hangs....then no other X-based apps can run. A reboot clears things.
>>
>>Any ideas?
> 
> 
> Seen in /etc/security/selinux/src/policy/Makefile:
> 
> relabel:  $(FC) $(SETFILES)
>         @echo "Cleaning out /tmp"
>         -rm -rf /tmp/.??* /tmp/*
> 
> which is where your /tmp/sepcut-* and /tmp/.X11-unix/ went (the first
> explaining your sepcut error, the second explaining your X11 problem).
> 
> I'll let somebody else address the question of whether that 'rm' command
> is over-zealous, as I'm not sure what it's trying to do.  If it's trying to
> make sure there's no symlink attacks, it's going about it wrongly, as all
> that does is close down the race conditions a bit.
> 
> Most likely, what it *should* be doing is a mkdir and working inside that
> directory for temp files.

The "rm" line appears to have been added relatively recently to the 
relabel target.  My guess is that the rationale was that many of the 
files in /tmp were no longer labeled correctly after a relabel because 
most of them would have been created via a file transition rule (and 
thus a relabel would change them all to incorrect/default labels, most 
likely denying access to the files anyway if the system were in 
enforcing mode).

David


--
This message was distributed to subscribers of the selinux mailing 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.

  reply	other threads:[~2004-04-07 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 23:31 Sepcut Relabel problem Mark Shakespeare
2004-04-07 10:08 ` Valdis.Kletnieks
2004-04-07 16:17   ` David Caplan [this message]
2004-04-12 14:00     ` Russell Coker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407429A6.5090606@tresys.com \
    --to=dac@tresys.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=mshakes@llnl.gov \
    --cc=selinux-dev@tresys.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.