All of lore.kernel.org
 help / color / mirror / Atom feed
From: guido@trentalancia.com (Guido Trentalancia)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] restorecon needs to read bin_t symlinks
Date: Sat, 19 Mar 2011 21:38:05 +0100	[thread overview]
Message-ID: <1300567085.3101.35.camel@tesla.lan> (raw)
In-Reply-To: <20110319200535.GA6479@siphos.be>

On Sat, 19/03/2011 at 21.05 +0100, Sven Vermeulen wrote:
> On Sat, Mar 19, 2011 at 08:54:46PM +0100, Guido Trentalancia wrote:
> > Actually it has nothing to do with restorecon being a symbolic link to
> > the setfiles binary.
> > 
> > Without the "read" capability restorecon is not able to relabel the
> > target file. This is quite bad as we could have non-standard things such
> > as:
> > 
> > ls -al /bin/example_executable
> > lrwxrwxrwx. root root /bin/example_executable
> > -> /opt/example/example_application
> > 
> > and example_application never getting relabelled as bin_t (but instead
> > falling back to usr_t).
> 
> Actually, I would imagine we don't want restorecon to follow symlinks to
> relabel the target files. If we did, then in your example both usr_t and
> bin_t for /opt/example/example_application are valid labels (which isn't
> possible).
> 
> restorecon /bin/example_executable
> restorecon /opt/example/example_application
> 
> The statements would switch the label. A full filesystem relabel, which is
> sometimes touted to be a good solution in case of problems, is in this case
> undecisive as we don't know in which order the files are scanned.

The example was not just wrong, it was mad. If that was really
happening, then an unprivileged user could potentially relabel the
entire filesystem at will by just creating symbolic links into his/her
home directory, labelling them at will and running the relabelling tool
on each of those links. Clearly (and fortunately) the label is not taken
from the source file !

However, the conclusion is either we want setfiles/restorecon to relabel
the target or we want to "dontaudit" read operations on symbolic links.
I am quite sure we don't want the logs flooded.

Regards,

Guido

  parent reply	other threads:[~2011-03-19 20:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19 15:45 [refpolicy] restorecon needs to read bin_t symlinks Guido Trentalancia
2011-03-19 15:51 ` Dominick Grift
2011-03-19 17:12   ` Guido Trentalancia
2011-03-19 19:54     ` Guido Trentalancia
2011-03-19 20:05       ` Sven Vermeulen
2011-03-19 20:25         ` Guido Trentalancia
2011-03-19 20:38         ` Guido Trentalancia [this message]
2011-03-21 13:29           ` Christopher J. PeBenito
     [not found]   ` <1300555758.3034.35.camel@tesla.lan>
     [not found]     ` <4D84E955.8030304@gmail.com>
     [not found]       ` <1300556614.3034.47.camel@tesla.lan>
     [not found]         ` <4D84EBC4.2050504@gmail.com>
     [not found]           ` <1300557149.3034.52.camel@tesla.lan>
     [not found]             ` <4D84EE9B.20604@gmail.com>
     [not found]               ` <1300558205.18208.2.camel@tesla.lan>
2011-03-19 18:15                 ` Dominick Grift
2011-03-22 12:12                   ` Daniel J Walsh

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=1300567085.3101.35.camel@tesla.lan \
    --to=guido@trentalancia.com \
    --cc=refpolicy@oss.tresys.com \
    /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.