mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zackw@panix.com>
To: "Stephen Smalley" <sds@tycho.nsa.gov>
Cc: "Chris Wright" <chrisw@sous-sol.org>,
	"Sergey Vlasov" <vsu@altlinux.ru>,
	linux-kernel@vger.kernel.org, jmorris@namei.org
Subject: Re: RFC PATCH: apply security_syslog() only to the syslog() syscall, not to /proc/kmsg
Date: Thu, 9 Nov 2006 09:39:13 -0800	[thread overview]
Message-ID: <eb97335b0611090939x7afbca7fkb5da56a15f0895c0@mail.gmail.com> (raw)
In-Reply-To: <1163090431.12241.358.camel@moss-spartans.epoch.ncsc.mil>

On 11/9/06, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> Unless I missed something, your plan above would disable SELinux
> syslog-related permission checking upon reads of a previously opened
> file descriptor to /proc/kmsg.  So it would change SELinux behavior in a
> way that is directly contrary to the notion of mandatory access control.

Yes, it would do that; no, I don't see why that change is contrary to
the notion of mandatory access control.  An open fd on /proc/kmsg
(with my changes applied) offers strictly fewer privileges than
SYSTEM__SYSLOG_MOD (no access to opcodes 4 and 5), and with SELinux
active, you can't get that open fd without having had
SYSTEM__SYSLOG_MOD at some prior time.  SELinux does not (as far as I
can tell) do MAC checks for access to normal files at read() time,
only open().

I see this as bringing /proc/kmsg in line with standard Unix file
permission semantics, overall.

> Part 4 appears to further expose /proc/kmsg to access by any uid 0
> process even if it has no capabilities (think privilege shedding or
> containers).

Only in the default privilege model, not in SELinux.  (CAP_SYS_ADMIN
is a hell of a lot more powerful than SYSTEM__SYSLOG_MOD.)  And I
could be talked out of part 4.

> But having a mapping in the core to a much
> smaller set of permissions would be even better, and help with
> maintenance; the next time someone added a new code, they would more
> likely see the mapping table in the core and update it than go digging
> into the individual security modules.

But that mapping is itself a security policy decision, and could
plausibly need to be done differently in different security modules...

zw

  reply	other threads:[~2006-11-09 17:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08  4:16 Zack Weinberg
2006-11-08 10:20 ` Chris Wright
2006-11-08 12:42   ` Sergey Vlasov
2006-11-08 12:45     ` [RFC PATCH 1/2] sys_syslog: check open permission for reading and getting unread count Sergey Vlasov
2006-11-08 12:45       ` [RFC PATCH 2/2] security: allow reads from an open /proc/kmsg fd by unprivileged processes Sergey Vlasov
2006-11-09  4:14     ` RFC PATCH: apply security_syslog() only to the syslog() syscall, not to /proc/kmsg Chris Wright
2006-11-09 14:50       ` Stephen Smalley
2006-11-09 16:08         ` Zack Weinberg
2006-11-09 16:40           ` Stephen Smalley
2006-11-09 17:39             ` Zack Weinberg [this message]
2006-11-09 20:53               ` Stephen Smalley
2006-11-10  0:40                 ` Zack Weinberg

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=eb97335b0611090939x7afbca7fkb5da56a15f0895c0@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=chrisw@sous-sol.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=vsu@altlinux.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®