netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/7] secid reconciliation-v02: Add LSM hooks
@ 2006-09-08 16:50 Venkat Yekkirala
  2006-09-08 20:10 ` James Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Venkat Yekkirala @ 2006-09-08 16:50 UTC (permalink / raw)
  To: netdev, selinux; +Cc: jmorris, sds, chanson

Add skb_policy_check and skb_netfilter_check hooks to LSM to enable
reconciliation of the various security identifiers as well as enforce
flow control on inbound (INPUT/FORWARD) and outbound (OUTPUT/FORWARD)
traffic.

Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com>
---
 include/linux/security.h |   32 ++++++++++++++++++++++++++++++++
 security/dummy.c         |   13 +++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/include/linux/security.h b/include/linux/security.h
index 9f56fb8..032cede 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -828,6 +828,12 @@ #ifdef CONFIG_SECURITY
  *	Sets the new child socket's sid to the openreq sid.
  * @req_classify_flow:
  *	Sets the flow's sid to the openreq sid.
+ * @skb_policy_check:
+ *	Checks to see if security policy would allow skb into the system.
+ *	Returns 1 if skb allowed into system, 0 otherwise.
+ * @skb_netfilter_check:
+ *	Checks to see if security policy would allow skb to go out of system.
+ *	Returns 1 if skb allowed out of system, 0 otherwise.
  *
  * Security hooks for XFRM operations.
  *
@@ -1372,6 +1378,8 @@ #ifdef CONFIG_SECURITY_NETWORK
 					struct request_sock *req);
 	void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req);
 	void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl);
+	int (*skb_policy_check)(struct sk_buff *skb, unsigned short family);
+	int (*skb_netfilter_check)(struct sk_buff *skb, u32 nf_secid);
 #endif	/* CONFIG_SECURITY_NETWORK */
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -2946,6 +2954,18 @@ static inline void security_req_classify
 	security_ops->req_classify_flow(req, fl);
 }
 
+static inline int security_skb_policy_check(struct sk_buff *skb,
+					unsigned short family)
+{
+	return security_ops->skb_policy_check(skb, family);
+}
+
+static inline int security_skb_netfilter_check(struct sk_buff *skb,
+					u32 nf_secid)
+{
+	return security_ops->skb_netfilter_check(skb, nf_secid);
+}
+
 static inline void security_sock_graft(struct sock* sk, struct socket *parent)
 {
 	security_ops->sock_graft(sk, parent);
@@ -3097,6 +3117,18 @@ static inline void security_req_classify
 {
 }
 
+static inline int security_skb_policy_check(struct sk_buff *skb,
+					unsigned short family)
+{
+	return 1;
+}
+
+static inline int security_skb_netfilter_check(struct sk_buff *skb,
+					u32 nf_secid)
+{
+	return 1;
+}
+
 static inline void security_sock_graft(struct sock* sk, struct socket *parent)
 {
 }
diff --git a/security/dummy.c b/security/dummy.c
index aeee705..077d3c9 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -832,6 +832,17 @@ static inline void dummy_req_classify_fl
 			struct flowi *fl)
 {
 }
+
+static inline int dummy_skb_policy_check(struct sk_buff *skb,
+			unsigned short family)
+{
+	return 1;
+}
+
+static inline int dummy_skb_netfilter_check(struct sk_buff *skb, u32 nf_secid)
+{
+	return 1;
+}
 #endif	/* CONFIG_SECURITY_NETWORK */
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -1108,6 +1119,8 @@ #ifdef CONFIG_SECURITY_NETWORK
 	set_to_dummy_if_null(ops, inet_conn_request);
 	set_to_dummy_if_null(ops, inet_csk_clone);
 	set_to_dummy_if_null(ops, req_classify_flow);
+	set_to_dummy_if_null(ops, skb_policy_check);
+	set_to_dummy_if_null(ops, skb_netfilter_check);
  #endif	/* CONFIG_SECURITY_NETWORK */
 #ifdef  CONFIG_SECURITY_NETWORK_XFRM
 	set_to_dummy_if_null(ops, xfrm_policy_alloc_security);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/7] secid reconciliation-v02: Add LSM hooks
  2006-09-08 16:50 [PATCH 2/7] secid reconciliation-v02: Add LSM hooks Venkat Yekkirala
@ 2006-09-08 20:10 ` James Morris
  0 siblings, 0 replies; 4+ messages in thread
From: James Morris @ 2006-09-08 20:10 UTC (permalink / raw)
  To: Venkat Yekkirala; +Cc: netdev, selinux, sds, chanson

On Fri, 8 Sep 2006, Venkat Yekkirala wrote:

> Add skb_policy_check and skb_netfilter_check hooks to LSM to enable
> reconciliation of the various security identifiers as well as enforce
> flow control on inbound (INPUT/FORWARD) and outbound (OUTPUT/FORWARD)
> traffic.

Is there any way you can send patches without "format=flowed" in the 
content-type?  On two mailers I've tried, the patches get mangled.



- James
-- 
James Morris
<jmorris@namei.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/7] secid reconciliation-v02: Add LSM hooks
@ 2006-09-10 16:52 Venkat Yekkirala
  2006-09-10 20:49 ` James Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Venkat Yekkirala @ 2006-09-10 16:52 UTC (permalink / raw)
  To: James Morris; +Cc: netdev, selinux, sds, Chad Hanson

> Is there any way you can send patches without "format=flowed" in the 
> content-type?  On two mailers I've tried, the patches get mangled.

Yes. I will send them to you in a few minutes with format=flowed disabled.
As soon as you let me know you see them fine, I will resend them to the
lists.
Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/7] secid reconciliation-v02: Add LSM hooks
  2006-09-10 16:52 Venkat Yekkirala
@ 2006-09-10 20:49 ` James Morris
  0 siblings, 0 replies; 4+ messages in thread
From: James Morris @ 2006-09-10 20:49 UTC (permalink / raw)
  To: Venkat Yekkirala; +Cc: netdev, selinux, sds, Chad Hanson

On Sun, 10 Sep 2006, Venkat Yekkirala wrote:

> > Is there any way you can send patches without "format=flowed" in the 
> > content-type?  On two mailers I've tried, the patches get mangled.
> 
> Yes. I will send them to you in a few minutes with format=flowed disabled.
> As soon as you let me know you see them fine, I will resend them to the
> lists.

Tanks, they look fine now.  Don't worry about re-sending yet.



-- 
James Morris
<jmorris@namei.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-10 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-08 16:50 [PATCH 2/7] secid reconciliation-v02: Add LSM hooks Venkat Yekkirala
2006-09-08 20:10 ` James Morris
  -- strict thread matches above, loose matches on Subject: below --
2006-09-10 16:52 Venkat Yekkirala
2006-09-10 20:49 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).