History

netfilter: nf_tables: add SECMARK support

Add the ability to set the security context of packets within the nf_tables framework. Add a nft_object for holding security contexts in the kernel and manipulating packets on the wire. Convert the security context strings at rule addition time to security identifiers. This is the same behavior like in xt_SECMARK and offers better performance than computing it per packet. Set the maximum security context length to 256.

Christian Göttsche committed 8 years ago

Commit fb961941 parent 097f95d4 files · +153 −5Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+17−1
@@ -1176,6 +1176,21 @@ enum nft_quota_attributes { · 1175 unmodified lines
11761176 };
11771177 #define NFTA_QUOTA_MAX (__NFTA_QUOTA_MAX - 1)
11781178
1179+/**
1180+ * enum nft_secmark_attributes - nf_tables secmark object netlink attributes
1181+ *
1182+ * @NFTA_SECMARK_CTX: security context (NLA_STRING)
1183+ */
1184+enum nft_secmark_attributes {
1185+ NFTA_SECMARK_UNSPEC,
1186+ NFTA_SECMARK_CTX,
1187+ __NFTA_SECMARK_MAX,
1188+};
1189+#define NFTA_SECMARK_MAX (__NFTA_SECMARK_MAX - 1)
1190+
1191+/* Max security context length */
1192+#define NFT_SECMARK_CTX_MAXLEN 256
1193+
11791194 /**
11801195 * enum nft_reject_types - nf_tables reject expression reject types
11811196 *
@@ -1432,7 +1447,8 @@ enum nft_ct_timeout_timeout_attributes { · 250 unmodified lines
14321447 #define NFT_OBJECT_CONNLIMIT 5
14331448 #define NFT_OBJECT_TUNNEL 6
14341449 #define NFT_OBJECT_CT_TIMEOUT 7
1435−#define __NFT_OBJECT_MAX 8
1450+#define NFT_OBJECT_SECMARK 8
1451+#define __NFT_OBJECT_MAX 9
14361452 #define NFT_OBJECT_MAX (__NFT_OBJECT_MAX - 1)
14371453
14381454 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t