Skip to contentSkip to conversation

remove net related includes from security.h

PATCH In review Arnaldo Carvalho de Melo 2 participants 2 messages Oct 19, 2004

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove net related includes from security.h

Hi Chris,

As discussed on irc.

Best Regards,

- Arnaldo

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================

[email protected], 2004-10-19 15:00:01-03:00, [email protected]
[LSM] remove net related includes from security.h

With this we're back to the times when changing skbuff.h only triggers rebuild of _net_ related stuff 8)

This uncovered a bug in rmap.h, that was not including mm.h to get the definition of struct vm_area_struct, working by luck.

 include/linux/rmap.h     |    1 +
 include/linux/security.h |   20 +++++++-------------
 security/commoncap.c     |   17 +++++++++++++++++
 3 files changed, 25 insertions(+), 13 deletions(-)
include/linux/rmap.h +1 -0
diff -Nru a/include/linux/rmap.h b/include/linux/rmap.h
@@ -7,6 +7,7 @@
 #include <linux/config.h>
 #include <linux/list.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/spinlock.h>
 
 /*
include/linux/security.h +7 -13
diff -Nru a/include/linux/security.h b/include/linux/security.h
@@ -31,8 +31,6 @@
 #include <linux/shm.h>
 #include <linux/msg.h>
 #include <linux/sched.h>
-#include <linux/skbuff.h>
-#include <linux/netlink.h>
 
 /*
  * These functions are in security/capability.c and are used
@@ -53,18 +51,14 @@
 extern int cap_syslog (int type);
 extern int cap_vm_enough_memory (long pages);
 
-static inline int cap_netlink_send (struct sock *sk, struct sk_buff *skb)
-{
-	NETLINK_CB (skb).eff_cap = current->cap_effective;
-	return 0;
-}
+struct msghdr;
+struct sk_buff;
+struct sock;
+struct sockaddr;
+struct socket;
 
-static inline int cap_netlink_recv (struct sk_buff *skb)
-{
-	if (!cap_raised (NETLINK_CB (skb).eff_cap, CAP_NET_ADMIN))
-		return -EPERM;
-	return 0;
-}
+extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
+extern int cap_netlink_recv(struct sk_buff *skb);
 
 /*
  * Values used in the task_security_ops calls
security/commoncap.c +17 -0
diff -Nru a/security/commoncap.c b/security/commoncap.c
@@ -24,6 +24,23 @@
 #include <linux/xattr.h>
 #include <linux/hugetlb.h>
 
+int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
+{
+	NETLINK_CB(skb).eff_cap = current->cap_effective;
+	return 0;
+}
+
+EXPORT_SYMBOL(cap_netlink_send);
+
+int cap_netlink_recv(struct sk_buff *skb)
+{
+	if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN))
+		return -EPERM;
+	return 0;
+}
+
+EXPORT_SYMBOL(cap_netlink_recv);
+
 int cap_capable (struct task_struct *tsk, int cap)
 {
 	/* Derived from include/linux/sched.h:capable. */

===================================================================

This BitKeeper patch contains the following changesets:
1.2119
## Wrapped with gzip_uu ##

M'XL( +A:=4$ ^U8:V_;-A3];/Z*._3#DBV625&2+;L)\D07-"\D+;JA*PR* MHBS!>@04%3>8]M]W:>?AID[0!-VGUJ]8%'GNX;WW',EY!>]KI8<=(0M%7L$? M56V&'5F52IKL2CBR*IQ(XXGSJL(3/?79:-&SDWO1M%=/QU&3)%W7";IY)45. M<.:9,#*%*Z7K88<Y_&[$7%^J8>?\X,W[HYUS0C8W82\5Y41=* .;F\14^DKD M<;TM3)I7I8-QRKI09LZAO9O:NI2Z^/19GU,_:%E O7XK6<R8\)B*J>L- H]8 MAML/M_$EBL<H"^URUVT]YE%*]H$Y+F,A4*_': ^_,'](Z9"R+N7X!5:BPN\< MNI3LPO?=P1Z1\/'HXO@3:%545PI*S)-6N3 JAJR4>1.K&A)=%5 KV>C,7#LI MKL'7A\[email protected](A)PB.QQ28+("E\U258*TC+)R O745G&^NBKS:S Z MFTRP?A@N:K(\ABJ!,88?W\6O#2Z P?HBWCL;JBDELM1X4D#43) BZ$)<.ND& MQA4&9J*&LC(WU#$L+BP*)[7$)K@U2RY6259F)JM*&[(VNI$&KHJQT$J,%X<; MN&Q6Z:GE'5U#WLBILV!QD4U*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 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net