diff options
Diffstat (limited to 'security/dummy.c')
-rw-r--r-- | security/dummy.c | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/security/dummy.c b/security/dummy.c index 58c6d399c844..aeee70565509 100644 --- a/security/dummy.c +++ b/security/dummy.c | |||
@@ -709,10 +709,10 @@ static int dummy_socket_create (int family, int type, | |||
709 | return 0; | 709 | return 0; |
710 | } | 710 | } |
711 | 711 | ||
712 | static void dummy_socket_post_create (struct socket *sock, int family, int type, | 712 | static int dummy_socket_post_create (struct socket *sock, int family, int type, |
713 | int protocol, int kern) | 713 | int protocol, int kern) |
714 | { | 714 | { |
715 | return; | 715 | return 0; |
716 | } | 716 | } |
717 | 717 | ||
718 | static int dummy_socket_bind (struct socket *sock, struct sockaddr *address, | 718 | static int dummy_socket_bind (struct socket *sock, struct sockaddr *address, |
@@ -805,14 +805,38 @@ static inline void dummy_sk_free_security (struct sock *sk) | |||
805 | { | 805 | { |
806 | } | 806 | } |
807 | 807 | ||
808 | static unsigned int dummy_sk_getsid(struct sock *sk, struct flowi *fl, u8 dir) | 808 | static inline void dummy_sk_clone_security (const struct sock *sk, struct sock *newsk) |
809 | { | ||
810 | } | ||
811 | |||
812 | static inline void dummy_sk_getsecid(struct sock *sk, u32 *secid) | ||
813 | { | ||
814 | } | ||
815 | |||
816 | static inline void dummy_sock_graft(struct sock* sk, struct socket *parent) | ||
817 | { | ||
818 | } | ||
819 | |||
820 | static inline int dummy_inet_conn_request(struct sock *sk, | ||
821 | struct sk_buff *skb, struct request_sock *req) | ||
809 | { | 822 | { |
810 | return 0; | 823 | return 0; |
811 | } | 824 | } |
825 | |||
826 | static inline void dummy_inet_csk_clone(struct sock *newsk, | ||
827 | const struct request_sock *req) | ||
828 | { | ||
829 | } | ||
830 | |||
831 | static inline void dummy_req_classify_flow(const struct request_sock *req, | ||
832 | struct flowi *fl) | ||
833 | { | ||
834 | } | ||
812 | #endif /* CONFIG_SECURITY_NETWORK */ | 835 | #endif /* CONFIG_SECURITY_NETWORK */ |
813 | 836 | ||
814 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 837 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
815 | static int dummy_xfrm_policy_alloc_security(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | 838 | static int dummy_xfrm_policy_alloc_security(struct xfrm_policy *xp, |
839 | struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk) | ||
816 | { | 840 | { |
817 | return 0; | 841 | return 0; |
818 | } | 842 | } |
@@ -831,7 +855,8 @@ static int dummy_xfrm_policy_delete_security(struct xfrm_policy *xp) | |||
831 | return 0; | 855 | return 0; |
832 | } | 856 | } |
833 | 857 | ||
834 | static int dummy_xfrm_state_alloc_security(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) | 858 | static int dummy_xfrm_state_alloc_security(struct xfrm_state *x, |
859 | struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *pol, u32 secid) | ||
835 | { | 860 | { |
836 | return 0; | 861 | return 0; |
837 | } | 862 | } |
@@ -849,6 +874,23 @@ static int dummy_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) | |||
849 | { | 874 | { |
850 | return 0; | 875 | return 0; |
851 | } | 876 | } |
877 | |||
878 | static int dummy_xfrm_state_pol_flow_match(struct xfrm_state *x, | ||
879 | struct xfrm_policy *xp, struct flowi *fl) | ||
880 | { | ||
881 | return 1; | ||
882 | } | ||
883 | |||
884 | static int dummy_xfrm_flow_state_match(struct flowi *fl, struct xfrm_state *xfrm) | ||
885 | { | ||
886 | return 1; | ||
887 | } | ||
888 | |||
889 | static int dummy_xfrm_decode_session(struct sk_buff *skb, u32 *fl, int ckall) | ||
890 | { | ||
891 | return 0; | ||
892 | } | ||
893 | |||
852 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 894 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
853 | static int dummy_register_security (const char *name, struct security_operations *ops) | 895 | static int dummy_register_security (const char *name, struct security_operations *ops) |
854 | { | 896 | { |
@@ -1060,7 +1102,12 @@ void security_fixup_ops (struct security_operations *ops) | |||
1060 | set_to_dummy_if_null(ops, socket_getpeersec_dgram); | 1102 | set_to_dummy_if_null(ops, socket_getpeersec_dgram); |
1061 | set_to_dummy_if_null(ops, sk_alloc_security); | 1103 | set_to_dummy_if_null(ops, sk_alloc_security); |
1062 | set_to_dummy_if_null(ops, sk_free_security); | 1104 | set_to_dummy_if_null(ops, sk_free_security); |
1063 | set_to_dummy_if_null(ops, sk_getsid); | 1105 | set_to_dummy_if_null(ops, sk_clone_security); |
1106 | set_to_dummy_if_null(ops, sk_getsecid); | ||
1107 | set_to_dummy_if_null(ops, sock_graft); | ||
1108 | set_to_dummy_if_null(ops, inet_conn_request); | ||
1109 | set_to_dummy_if_null(ops, inet_csk_clone); | ||
1110 | set_to_dummy_if_null(ops, req_classify_flow); | ||
1064 | #endif /* CONFIG_SECURITY_NETWORK */ | 1111 | #endif /* CONFIG_SECURITY_NETWORK */ |
1065 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1112 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
1066 | set_to_dummy_if_null(ops, xfrm_policy_alloc_security); | 1113 | set_to_dummy_if_null(ops, xfrm_policy_alloc_security); |
@@ -1071,6 +1118,9 @@ void security_fixup_ops (struct security_operations *ops) | |||
1071 | set_to_dummy_if_null(ops, xfrm_state_free_security); | 1118 | set_to_dummy_if_null(ops, xfrm_state_free_security); |
1072 | set_to_dummy_if_null(ops, xfrm_state_delete_security); | 1119 | set_to_dummy_if_null(ops, xfrm_state_delete_security); |
1073 | set_to_dummy_if_null(ops, xfrm_policy_lookup); | 1120 | set_to_dummy_if_null(ops, xfrm_policy_lookup); |
1121 | set_to_dummy_if_null(ops, xfrm_state_pol_flow_match); | ||
1122 | set_to_dummy_if_null(ops, xfrm_flow_state_match); | ||
1123 | set_to_dummy_if_null(ops, xfrm_decode_session); | ||
1074 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 1124 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
1075 | #ifdef CONFIG_KEYS | 1125 | #ifdef CONFIG_KEYS |
1076 | set_to_dummy_if_null(ops, key_alloc); | 1126 | set_to_dummy_if_null(ops, key_alloc); |