From: Chris Wright <chrisw@sous-sol.org>
To: James Morris <jmorris@namei.org>
Cc: linux-kernel@vger.kernel.org, Stephen Smalley <sds@tycho.nsa.gov>,
Chris Wright <chrisw@sous-sol.org>, Greg KH <greg@kroah.com>
Subject: Re: HOWTO add privileged code to the kernel without breaking LSM/SELinux
Date: Wed, 7 Jun 2006 15:43:26 -0700 [thread overview]
Message-ID: <20060607224326.GM2697@moss.sous-sol.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0606060229240.10150@d.namei>
* James Morris (jmorris@namei.org) wrote:
> If you add any new code to the kernel which exposes any kind of
> privileged operation to userspace, then it probably needs an LSM hook and
> subsequent changes to SELinux.
>
> It would certainly be unreasonable to expect all kernel developers to know
> how to do this, however, it is usually very simple to determine when a new
> LSM would be needed as a first step.
>
> The simple tests are: does the code you're adding perform any new DAC
> checks involving any of the user or group ID fields of a task? Did you
> add a capable() call? Does it call DAC helper functions?
The set_task_ioprio changes would make a nice concrete example.
> If so, it's possible that a corresponding MAC check needs to be added via
> LSM; and I'd ask that you simply cc any or all of the LSM and/or SELinux
> maintainers when posting such patches upstream for RFC or inclusion. We
> can work on the LSM and SELinux side of things if needed.
>
> This will not cover every case, but I think it will cover most of the ones
> that are likely to come up in the future. If in doubt, it won't hurt to ask.
On a related note. When adding sysfs files, file perms (and for SELinux,
super block label) are the lowest common denominator for protections,
but should also be considered the last resort. Smth 0644 may need e.g,
an explicit capable() check in ->store (in addition to the implicit
permission() check).
thanks,
-chris
prev parent reply other threads:[~2006-06-07 22:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-06 6:51 James Morris
2006-06-06 6:54 ` Greg KH
2006-06-06 7:02 ` James Morris
2006-06-07 22:43 ` Chris Wright [this message]
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=20060607224326.GM2697@moss.sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=greg@kroah.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@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 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®