All of lore.kernel.org
 help / color / mirror / Atom feed
* HOWTO add privileged code to the kernel without breaking LSM/SELinux
@ 2006-06-06  6:51 James Morris
  2006-06-06  6:54 ` Greg KH
  2006-06-07 22:43 ` Chris Wright
  0 siblings, 2 replies; 4+ messages in thread
From: James Morris @ 2006-06-06  6:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Smalley, Chris Wright, Greg KH

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?

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.


(CC'd GKH hoping something of this can go into his kernel hacking howto).


- James
-- 
James Morris
<jmorris@namei.org>

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

end of thread, other threads:[~2006-06-07 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-06  6:51 HOWTO add privileged code to the kernel without breaking LSM/SELinux James Morris
2006-06-06  6:54 ` Greg KH
2006-06-06  7:02   ` James Morris
2006-06-07 22:43 ` Chris Wright

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.