diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-28 20:30:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-28 20:30:42 -0400 |
commit | 7541bba880fb6989f489f0c68fa246a375b44035 (patch) | |
tree | 19ce55af8e8732aa61cb8db529cf2304d9d738b5 /include | |
parent | 795e2fe0a3b69dbc040d7efcf517e0cbad6901d0 (diff) | |
parent | 4303154e86597885bc3cbc178a48ccbc8213875f (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.h | 13 | ||||
-rw-r--r-- | include/net/cipso_ipv4.h | 17 | ||||
-rw-r--r-- | include/net/netlabel.h | 17 |
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 | |||
2537 | int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen); | 2530 | int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen); |
2538 | int security_socket_listen(struct socket *sock, int backlog); | 2531 | int security_socket_listen(struct socket *sock, int backlog); |
2539 | int security_socket_accept(struct socket *sock, struct socket *newsock); | 2532 | int security_socket_accept(struct socket *sock, struct socket *newsock); |
2540 | void security_socket_post_accept(struct socket *sock, struct socket *newsock); | ||
2541 | int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size); | 2533 | int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size); |
2542 | int security_socket_recvmsg(struct socket *sock, struct msghdr *msg, | 2534 | int 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 | ||
2619 | static inline void security_socket_post_accept(struct socket *sock, | ||
2620 | struct socket *newsock) | ||
2621 | { | ||
2622 | } | ||
2623 | |||
2624 | static inline int security_socket_sendmsg(struct socket *sock, | 2611 | static 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); |
216 | void cipso_v4_sock_delattr(struct sock *sk); | 217 | void cipso_v4_sock_delattr(struct sock *sk); |
217 | int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); | 218 | int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); |
219 | int cipso_v4_req_setattr(struct request_sock *req, | ||
220 | const struct cipso_v4_doi *doi_def, | ||
221 | const struct netlbl_lsm_secattr *secattr); | ||
222 | void cipso_v4_req_delattr(struct request_sock *req); | ||
218 | int cipso_v4_skbuff_setattr(struct sk_buff *skb, | 223 | int 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 | ||
255 | static 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 | |||
262 | static inline void cipso_v4_req_delattr(struct request_sock *req) | ||
263 | { | ||
264 | return; | ||
265 | } | ||
266 | |||
250 | static inline int cipso_v4_skbuff_setattr(struct sk_buff *skb, | 267 | static 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 | ||
41 | struct cipso_v4_doi; | 42 | struct cipso_v4_doi; |
@@ -406,6 +407,7 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap, | |||
406 | */ | 407 | */ |
407 | int netlbl_enabled(void); | 408 | int netlbl_enabled(void); |
408 | int netlbl_sock_setattr(struct sock *sk, | 409 | int netlbl_sock_setattr(struct sock *sk, |
410 | u16 family, | ||
409 | const struct netlbl_lsm_secattr *secattr); | 411 | const struct netlbl_lsm_secattr *secattr); |
410 | void netlbl_sock_delattr(struct sock *sk); | 412 | void netlbl_sock_delattr(struct sock *sk); |
411 | int netlbl_sock_getattr(struct sock *sk, | 413 | int netlbl_sock_getattr(struct sock *sk, |
@@ -413,6 +415,9 @@ int netlbl_sock_getattr(struct sock *sk, | |||
413 | int netlbl_conn_setattr(struct sock *sk, | 415 | int 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); |
418 | int netlbl_req_setattr(struct request_sock *req, | ||
419 | const struct netlbl_lsm_secattr *secattr); | ||
420 | void netlbl_req_delattr(struct request_sock *req); | ||
416 | int netlbl_skbuff_setattr(struct sk_buff *skb, | 421 | int 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 | } |
521 | static inline int netlbl_sock_setattr(struct sock *sk, | 526 | static 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 | } |
546 | static inline int netlbl_req_setattr(struct request_sock *req, | ||
547 | const struct netlbl_lsm_secattr *secattr) | ||
548 | { | ||
549 | return -ENOSYS; | ||
550 | } | ||
551 | static inline void netlbl_req_delattr(struct request_sock *req) | ||
552 | { | ||
553 | return; | ||
554 | } | ||
540 | static inline int netlbl_skbuff_setattr(struct sk_buff *skb, | 555 | static 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) |