[PATCH RFC] capabilities: remove STRICT_CAP_T_TYPECHECKS

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Serge E. Hallyn <serue@...>
Cc: <linux-security-module@...>, lkml <linux-kernel@...>, Chris Wright <chrisw@...>, Andrew Morgan <morgan@...>, Stephen Smalley <sds@...>, Casey Schaufler <casey@...>
Date: Friday, October 19, 2007 - 4:36 pm

Quoting Serge E. Hallyn (serue@us.ibm.com):

Here is the second alternative, simply removing the
STRICT_CAP_T_TYPECHECKS option.

thanks,
-serge

From 141626df6eaba12f5566f6bce7e72c1c3e627364 Mon Sep 17 00:00:00 2001
From: Serge E. Hallyn <serue@us.ibm.com>
Date: Wed, 17 Oct 2007 10:00:49 -0400
Subject: [PATCH 1/1] capabilities: remove STRICT_CAP_T_TYPECHECKS

It appears STRICT_CAP_T_TYPECHECKS was introduced in 1998 - and
always undefined since then - because the STRICT_CAP_T_TYPECHECKS
behavior is broken.  (See http://www.uwsg.iu.edu/hypermail/linux/kernel/9810.2/0705.html)

Remove this code to simplify the capabilites code.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 include/linux/capability.h |   21 ---------------------
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/include/linux/capability.h b/include/linux/capability.h
index 7a8d7ad..8f7c7ed 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -64,20 +64,8 @@ struct vfs_cap_data {
 
 #ifdef __KERNEL__
 
-/* #define STRICT_CAP_T_TYPECHECKS */
-
-#ifdef STRICT_CAP_T_TYPECHECKS
-
-typedef struct kernel_cap_struct {
-	__u32 cap;
-} kernel_cap_t;
-
-#else
-
 typedef __u32 kernel_cap_t;
 
-#endif
-
 #define _USER_CAP_HEADER_SIZE  (2*sizeof(__u32))
 #define _KERNEL_CAP_T_SIZE     (sizeof(kernel_cap_t))
 
@@ -315,18 +303,9 @@ typedef __u32 kernel_cap_t;
  * Internal kernel functions only
  */
 
-#ifdef STRICT_CAP_T_TYPECHECKS
-
-#define to_cap_t(x) { x }
-#define cap_t(x) (x).cap
-
-#else
-
 #define to_cap_t(x) (x)
 #define cap_t(x) (x)
 
-#endif
-
 #define CAP_EMPTY_SET       to_cap_t(0)
 #define CAP_FULL_SET        to_cap_t(~0)
 #define CAP_INIT_EFF_SET    to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP))
-- 
1.5.1.1.GIT

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] capabilities: remove STRICT_CAP_T_TYPECHECKS, Serge E. Hallyn, (Fri Oct 19, 4:36 pm)