All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Chris Wright <chrisw@osdl.org>
Cc: netdev@oss.sgi.com
Subject: [PATCH][LSM] remove net related includes from security.h
Date: Tue, 19 Oct 2004 15:21:51 -0300	[thread overview]
Message-ID: <41755B3F.2040001@conectiva.com.br> (raw)

[-- Attachment #1: Type: text/plain, Size: 59 bytes --]

Hi Chris,

	As discussed on irc.

Best Regards,

- Arnaldo

[-- Attachment #2: lsm.patch --]
[-- Type: text/plain, Size: 4702 bytes --]

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

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


ChangeSet@1.2119, 2004-10-19 15:00:01-03:00, acme@conectiva.com.br
  [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.
  
  Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  Signed-off-by: Chris Wright <chrisw@osdl.org>


 include/linux/rmap.h     |    1 +
 include/linux/security.h |   20 +++++++-------------
 security/commoncap.c     |   17 +++++++++++++++++
 3 files changed, 25 insertions(+), 13 deletions(-)


diff -Nru a/include/linux/rmap.h b/include/linux/rmap.h
--- a/include/linux/rmap.h	2004-10-19 15:19:36 -03:00
+++ b/include/linux/rmap.h	2004-10-19 15:19:36 -03:00
@@ -7,6 +7,7 @@
 #include <linux/config.h>
 #include <linux/list.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/spinlock.h>
 
 /*
diff -Nru a/include/linux/security.h b/include/linux/security.h
--- a/include/linux/security.h	2004-10-19 15:19:36 -03:00
+++ b/include/linux/security.h	2004-10-19 15:19:36 -03:00
@@ -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
diff -Nru a/security/commoncap.c b/security/commoncap.c
--- a/security/commoncap.c	2004-10-19 15:19:36 -03:00
+++ b/security/commoncap.c	2004-10-19 15:19:36 -03:00
@@ -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[HYU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$^%&I&.5J;1)= 1^9?\30[^/#L]?S>^^.MX]_1H
M[2&1]1%.><A0*WFU]ABA+(&U7^QL+;):Q6N/$-R O9VS,9X<[^P?'YZLKY/.
M+;'NP=G!^?$SB%H^<Z)?7^_O96.]Z;O>S-W_+KJ\E&&?.K=M\_3]' W8@ W0
MBUCK^<Q?7/%Y^%Q#0C]B_*<A_7B&M/@1\.0E?ZDTSW>E?>Z!2_;] 'QR&%#\
MO$E)44_26(_(E\*_/T:K^N) Q,NS<4"9$=D/7 @0MX\QU&>C4-XO][_18Q"/
=&M3H_M\@,E5R6C?%9A &@P%-./D/)"G3TW$1    
 

             reply	other threads:[~2004-10-19 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 18:21 Arnaldo Carvalho de Melo [this message]
2004-10-19 18:42 ` [PATCH][LSM] remove net related includes from security.h Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41755B3F.2040001@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=chrisw@osdl.org \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.