Skip to contentSkip to conversation

Add selinux_relabel_packet_permission() check to xt_SECMARK (fwd)

RFC New James Morris 1 participant 1 message May 7, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 8/8 Add selinux_relabel_packet_permission() check to xt_SECMARK (fwd)

---------- Forwarded message ----------
Date: Sun, 7 May 2006 11:40:45 -0400 (EDT)
From: James Morris <[email protected]>
To: [email protected]
Cc: [email protected], [email protected],
Stephen Smalley <[email protected]>, Daniel J Walsh <[email protected]>
Subject: [RFC][SECMARK 08/08] Add selinux_relabel_packet_permission() check to
xt_SECMARK

This patch adds the selinux_relabel_packet_permission() check to the SECMARK target, so that SELinux policy is consulted to ensure that the labeling operation is permitted by the current task.

---

 net/netfilter/xt_SECMARK.c |    6 ++++++
 1 file changed, 6 insertions(+)
net/netfilter/xt_SECMARK.c +6 -0
diff -purN -X dontdiff linux-2.6.17-rc3-git7.p/net/netfilter/xt_SECMARK.c linux-2.6.17-rc3-git7.w/net/netfilter/xt_SECMARK.c
@@ -72,6 +72,12 @@ static int checkentry_selinux(struct xt_
 		return 0;
 	}
 
+	err = selinux_relabel_packet_permission(sel->selsid);
+	if (err) {
+		printk(KERN_INFO PFX "unable to obtain relabeling permission\n");
+		return 0;
+	}
+
 	return 1;
 }