Thread (3 messages) 3 messages, 2 authors, 2009-10-29

Re: [PATCH resend] define convenient securebits masks for prctl users

flat view

From: Stephen Rothwell <hidden>
Date: 2009-10-29 02:33:11
Also in: lkml

Hi Serge,

On Wed, 28 Oct 2009 09:02:36 -0500 "Serge E. Hallyn" [off-list ref] wrote:
[ Are there any objections to exporting securebits.h?  If not,
can this patch be pushed to linux-next? ]
I am not sure which tree this belongs in?  Maybe security-testing (James
cc'd)?
quoted hunk ↗ jump to hunk
diff --git a/include/linux/securebits.h b/include/linux/securebits.h
index d2c5ed8..9ad109e 100644
--- a/include/linux/securebits.h
+++ b/include/linux/securebits.h
@@ -1,6 +1,13 @@
 #ifndef _LINUX_SECUREBITS_H
 #define _LINUX_SECUREBITS_H 1
 
+/* Each securesetting is implemented using two bits. One bit specifies
+   whether the setting is on or off. The other bit specify whether the
+   setting is locked or not. A setting which is locked cannot be
+   changed from user-level. */
+#define issecure_mask(X)	(1 << (X))
+#define issecure(X)		(issecure_mask(X) & current_cred_xxx(securebits))
You want this second define protected by ifdef __KERNEL__ ...

-- 
Cheers,
Stephen Rothwell                    sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org
http://www.canb.auug.org.au/~sfr/

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help