aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-28 20:30:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-28 20:30:42 -0400
commit7541bba880fb6989f489f0c68fa246a375b44035 (patch)
tree19ce55af8e8732aa61cb8db529cf2304d9d738b5 /include
parent795e2fe0a3b69dbc040d7efcf517e0cbad6901d0 (diff)
parent4303154e86597885bc3cbc178a48ccbc8213875f (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: smack: Add a new '-CIPSO' option to the network address label configuration netlabel: Cleanup the Smack/NetLabel code to fix incoming TCP connections lsm: Remove the socket_post_accept() hook selinux: Remove the "compat_net" compatibility code netlabel: Label incoming TCP connections correctly in SELinux lsm: Relocate the IPv4 security_inet_conn_request() hooks TOMOYO: Fix a typo. smack: convert smack to standard linux lists
Diffstat (limited to 'include')
-rw-r--r--include/linux/security.h13
-rw-r--r--include/net/cipso_ipv4.h17
-rw-r--r--include/net/netlabel.h17
3 files changed, 33 insertions, 14 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 1f2ab6353c00..54ed15799a83 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -880,11 +880,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
880 * @sock contains the listening socket structure. 880 * @sock contains the listening socket structure.
881 * @newsock contains the newly created server socket for connection. 881 * @newsock contains the newly created server socket for connection.
882 * Return 0 if permission is granted. 882 * Return 0 if permission is granted.
883 * @socket_post_accept:
884 * This hook allows a security module to copy security
885 * information into the newly created socket's inode.
886 * @sock contains the listening socket structure.
887 * @newsock contains the newly created server socket for connection.
888 * @socket_sendmsg: 883 * @socket_sendmsg:
889 * Check permission before transmitting a message to another socket. 884 * Check permission before transmitting a message to another socket.
890 * @sock contains the socket structure. 885 * @sock contains the socket structure.
@@ -1554,8 +1549,6 @@ struct security_operations {
1554 struct sockaddr *address, int addrlen); 1549 struct sockaddr *address, int addrlen);
1555 int (*socket_listen) (struct socket *sock, int backlog); 1550 int (*socket_listen) (struct socket *sock, int backlog);
1556 int (*socket_accept) (struct socket *sock, struct socket *newsock); 1551 int (*socket_accept) (struct socket *sock, struct socket *newsock);
1557 void (*socket_post_accept) (struct socket *sock,
1558 struct socket *newsock);
1559 int (*socket_sendmsg) (struct socket *sock, 1552 int (*socket_sendmsg) (struct socket *sock,
1560 struct msghdr *msg, int size); 1553 struct msghdr *msg, int size);
1561 int (*socket_recvmsg) (struct socket *sock, 1554 int (*socket_recvmsg) (struct socket *sock,
@@ -2537,7 +2530,6 @@ int security_socket_bind(struct socket *sock, struct sockaddr *address, int addr
2537int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen); 2530int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen);
2538int security_socket_listen(struct socket *sock, int backlog); 2531int security_socket_listen(struct socket *sock, int backlog);
2539int security_socket_accept(struct socket *sock, struct socket *newsock); 2532int security_socket_accept(struct socket *sock, struct socket *newsock);
2540void security_socket_post_accept(struct socket *sock, struct socket *newsock);
2541int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size); 2533int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size);
2542int security_socket_recvmsg(struct socket *sock, struct msghdr *msg, 2534int security_socket_recvmsg(struct socket *sock, struct msghdr *msg,
2543 int size, int flags); 2535 int size, int flags);
@@ -2616,11 +2608,6 @@ static inline int security_socket_accept(struct socket *sock,
2616 return 0; 2608 return 0;
2617} 2609}
2618 2610
2619static inline void security_socket_post_accept(struct socket *sock,
2620 struct socket *newsock)
2621{
2622}
2623
2624static inline int security_socket_sendmsg(struct socket *sock, 2611static inline int security_socket_sendmsg(struct socket *sock,
2625 struct msghdr *msg, int size) 2612 struct msghdr *msg, int size)
2626{ 2613{
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index bedc7f62e35d..abd443604c9f 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -40,6 +40,7 @@
40#include <linux/net.h> 40#include <linux/net.h>
41#include <linux/skbuff.h> 41#include <linux/skbuff.h>
42#include <net/netlabel.h> 42#include <net/netlabel.h>
43#include <net/request_sock.h>
43#include <asm/atomic.h> 44#include <asm/atomic.h>
44 45
45/* known doi values */ 46/* known doi values */
@@ -215,6 +216,10 @@ int cipso_v4_sock_setattr(struct sock *sk,
215 const struct netlbl_lsm_secattr *secattr); 216 const struct netlbl_lsm_secattr *secattr);
216void cipso_v4_sock_delattr(struct sock *sk); 217void cipso_v4_sock_delattr(struct sock *sk);
217int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); 218int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
219int cipso_v4_req_setattr(struct request_sock *req,
220 const struct cipso_v4_doi *doi_def,
221 const struct netlbl_lsm_secattr *secattr);
222void cipso_v4_req_delattr(struct request_sock *req);
218int cipso_v4_skbuff_setattr(struct sk_buff *skb, 223int cipso_v4_skbuff_setattr(struct sk_buff *skb,
219 const struct cipso_v4_doi *doi_def, 224 const struct cipso_v4_doi *doi_def,
220 const struct netlbl_lsm_secattr *secattr); 225 const struct netlbl_lsm_secattr *secattr);
@@ -247,6 +252,18 @@ static inline int cipso_v4_sock_getattr(struct sock *sk,
247 return -ENOSYS; 252 return -ENOSYS;
248} 253}
249 254
255static inline int cipso_v4_req_setattr(struct request_sock *req,
256 const struct cipso_v4_doi *doi_def,
257 const struct netlbl_lsm_secattr *secattr)
258{
259 return -ENOSYS;
260}
261
262static inline void cipso_v4_req_delattr(struct request_sock *req)
263{
264 return;
265}
266
250static inline int cipso_v4_skbuff_setattr(struct sk_buff *skb, 267static inline int cipso_v4_skbuff_setattr(struct sk_buff *skb,
251 const struct cipso_v4_doi *doi_def, 268 const struct cipso_v4_doi *doi_def,
252 const struct netlbl_lsm_secattr *secattr) 269 const struct netlbl_lsm_secattr *secattr)
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 749011eedc0b..60ebbc1fef46 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -36,6 +36,7 @@
36#include <linux/in.h> 36#include <linux/in.h>
37#include <linux/in6.h> 37#include <linux/in6.h>
38#include <net/netlink.h> 38#include <net/netlink.h>
39#include <net/request_sock.h>
39#include <asm/atomic.h> 40#include <asm/atomic.h>
40 41
41struct cipso_v4_doi; 42struct cipso_v4_doi;
@@ -406,6 +407,7 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
406 */ 407 */
407int netlbl_enabled(void); 408int netlbl_enabled(void);
408int netlbl_sock_setattr(struct sock *sk, 409int netlbl_sock_setattr(struct sock *sk,
410 u16 family,
409 const struct netlbl_lsm_secattr *secattr); 411 const struct netlbl_lsm_secattr *secattr);
410void netlbl_sock_delattr(struct sock *sk); 412void netlbl_sock_delattr(struct sock *sk);
411int netlbl_sock_getattr(struct sock *sk, 413int netlbl_sock_getattr(struct sock *sk,
@@ -413,6 +415,9 @@ int netlbl_sock_getattr(struct sock *sk,
413int netlbl_conn_setattr(struct sock *sk, 415int netlbl_conn_setattr(struct sock *sk,
414 struct sockaddr *addr, 416 struct sockaddr *addr,
415 const struct netlbl_lsm_secattr *secattr); 417 const struct netlbl_lsm_secattr *secattr);
418int netlbl_req_setattr(struct request_sock *req,
419 const struct netlbl_lsm_secattr *secattr);
420void netlbl_req_delattr(struct request_sock *req);
416int netlbl_skbuff_setattr(struct sk_buff *skb, 421int netlbl_skbuff_setattr(struct sk_buff *skb,
417 u16 family, 422 u16 family,
418 const struct netlbl_lsm_secattr *secattr); 423 const struct netlbl_lsm_secattr *secattr);
@@ -519,7 +524,8 @@ static inline int netlbl_enabled(void)
519 return 0; 524 return 0;
520} 525}
521static inline int netlbl_sock_setattr(struct sock *sk, 526static inline int netlbl_sock_setattr(struct sock *sk,
522 const struct netlbl_lsm_secattr *secattr) 527 u16 family,
528 const struct netlbl_lsm_secattr *secattr)
523{ 529{
524 return -ENOSYS; 530 return -ENOSYS;
525} 531}
@@ -537,6 +543,15 @@ static inline int netlbl_conn_setattr(struct sock *sk,
537{ 543{
538 return -ENOSYS; 544 return -ENOSYS;
539} 545}
546static inline int netlbl_req_setattr(struct request_sock *req,
547 const struct netlbl_lsm_secattr *secattr)
548{
549 return -ENOSYS;
550}
551static inline void netlbl_req_delattr(struct request_sock *req)
552{
553 return;
554}
540static inline int netlbl_skbuff_setattr(struct sk_buff *skb, 555static inline int netlbl_skbuff_setattr(struct sk_buff *skb,
541 u16 family, 556 u16 family,
542 const struct netlbl_lsm_secattr *secattr) 557 const struct netlbl_lsm_secattr *secattr)