diff options
author | Paul Moore <paul.moore@hp.com> | 2008-10-10 10:16:31 -0400 |
---|---|---|
committer | Paul Moore <paul.moore@hp.com> | 2008-10-10 10:16:31 -0400 |
commit | dfaebe9825ff34983778f287101bc5f3bce00640 (patch) | |
tree | 4dccdcdcecd57fc8bfc083ff30d9e0ecb2e7ecba /security/selinux/netlabel.c | |
parent | 99d854d231ce141850b988bdc7e2e7c78f49b03a (diff) |
selinux: Fix missing calls to netlbl_skbuff_err()
At some point I think I messed up and dropped the calls to netlbl_skbuff_err()
which are necessary for CIPSO to send error notifications to remote systems.
This patch re-introduces the error handling calls into the SELinux code.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/netlabel.c')
-rw-r--r-- | security/selinux/netlabel.c | 20 |
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 | */ | ||
123 | void 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 | ||