summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Moore <paul.moore@hp.com>2009-05-08 17:58:43 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-18 16:34:50 -0700
commitda8c51d336b48a4f965f3f6aa04d3a461bb854ca (patch)
tree5383b818aafe7d6fa4ca20f856751543f571188b /include
parent81aef7a11718924e60f51bc4472bdbba74d4b1cb (diff)
netlabel: Add new NetLabel KAPI interfaces for request_sock security attributes
[NOTE: based on 389fb800ac8be2832efedd19978a2b8ced37eb61 and 07feee8f812f7327a46186f7604df312c8c81962] This patch adds the netlbl_req_setattr() and netlbl_req_delattr() functions which can be used by LSMs to set and remove the NetLabel security attributes from request_sock objects used in incoming connection requests. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/net/netlabel.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 749011eedc0b..bf77b5c602d6 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -36,6 +36,7 @@
#include <linux/in.h>
#include <linux/in6.h>
#include <net/netlink.h>
+#include <net/request_sock.h>
#include <asm/atomic.h>
struct cipso_v4_doi;
@@ -413,6 +414,9 @@ int netlbl_sock_getattr(struct sock *sk,
int netlbl_conn_setattr(struct sock *sk,
struct sockaddr *addr,
const struct netlbl_lsm_secattr *secattr);
+int netlbl_req_setattr(struct request_sock *req,
+ const struct netlbl_lsm_secattr *secattr);
+void netlbl_req_delattr(struct request_sock *req);
int netlbl_skbuff_setattr(struct sk_buff *skb,
u16 family,
const struct netlbl_lsm_secattr *secattr);
@@ -519,7 +523,7 @@ static inline int netlbl_enabled(void)
return 0;
}
static inline int netlbl_sock_setattr(struct sock *sk,
- const struct netlbl_lsm_secattr *secattr)
+ const struct netlbl_lsm_secattr *secattr)
{
return -ENOSYS;
}
@@ -537,6 +541,15 @@ static inline int netlbl_conn_setattr(struct sock *sk,
{
return -ENOSYS;
}
+static inline int netlbl_req_setattr(struct request_sock *req,
+ const struct netlbl_lsm_secattr *secattr)
+{
+ return -ENOSYS;
+}
+static inline void netlbl_req_delattr(struct request_sock *req)
+{
+ return;
+}
static inline int netlbl_skbuff_setattr(struct sk_buff *skb,
u16 family,
const struct netlbl_lsm_secattr *secattr)