Research
.
Skip Search Box

SELinux Mailing List

Re: BUG in security_context_to_sid() ?

From: Stephen Smalley <sds_at_epoch.ncsc.mil>
Date: Fri, 07 Jan 2005 09:47:55 -0500


On Fri, 2005-01-07 at 09:41, Park Lee wrote:
> Because there are also other hook functions (such as
> selinux_inode_setxattr(),
> selinux_inode_post_setxattr(),
> selinux_inode_setsecurity(), selinux_setprocattr(),
> etc.) who will call security_context_to_sid(). If I
> now change security_context_to_sid(), let it call
> kmalloc with GFP_ATOMIC rather than its original
> GFP_KERNEL, will this change cause problem when other
> hook functions call the modified
> security_context_to_sid() function?

It could cause them to fail under memory pressure rather than blocking and waiting for memory to become available. It would be preferable to change your code to convert the context to a SID while in process context, then use the saved SID when in non-blocking context.

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


--
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.
Received on Fri 7 Jan 2005 - 09:54:03 EST
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service