aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/netlabel.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/netlabel.c')
-rw-r--r--security/selinux/netlabel.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/security/selinux/netlabel.c b/security/selinux/netlabel.c
index b9ce5fcf3432..4053f7fc95fb 100644
--- a/security/selinux/netlabel.c
+++ b/security/selinux/netlabel.c
@@ -108,6 +108,24 @@ void selinux_netlbl_cache_invalidate(void)
108} 108}
109 109
110/** 110/**
111 * selinux_netlbl_err - Handle a NetLabel packet error
112 * @skb: the packet
113 * @error: the error code
114 * @gateway: true if host is acting as a gateway, false otherwise
115 *
116 * Description:
117 * When a packet is dropped due to a call to avc_has_perm() pass the error
118 * code to the NetLabel subsystem so any protocol specific processing can be
119 * done. This is safe to call even if you are unsure if NetLabel labeling is
120 * present on the packet, NetLabel is smart enough to only act when it should.
121 *
122 */
123void selinux_netlbl_err(struct sk_buff *skb, int error, int gateway)
124{
125 netlbl_skbuff_err(skb, error, gateway);
126}
127
128/**
111 * selinux_netlbl_sk_security_reset - Reset the NetLabel fields 129 * selinux_netlbl_sk_security_reset - Reset the NetLabel fields
112 * @ssec: the sk_security_struct 130 * @ssec: the sk_security_struct
113 * @family: the socket family 131 * @family: the socket family
@@ -289,7 +307,7 @@ int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec,
289 return 0; 307 return 0;
290 308
291 if (nlbl_sid != SECINITSID_UNLABELED) 309 if (nlbl_sid != SECINITSID_UNLABELED)
292 netlbl_skbuff_err(skb, rc); 310 netlbl_skbuff_err(skb, rc, 0);
293 return rc; 311 return rc;
294} 312}
295 313