Skip to contentSkip to conversation

netfilter: nf_tables: rise cap on SELinux secmark context

PATCH In review Pablo Neira Ayuso 2 participants 3 messages Jun 3, 2024 – Jun 26, 2024 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nf_tables: rise cap on SELinux secmark context

secmark context is artificially limited 256 bytes, rise it to 4Kbytes.

Fixes fb961945457f ("netfilter: nf_tables: add SECMARK support")
---
 include/uapi/linux/netfilter/nf_tables.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/netfilter/nf_tables.h +1 -1
index aa4094ca2444..639894ed1b97 100644
@@ -1376,7 +1376,7 @@ enum nft_secmark_attributes {
 #define NFTA_SECMARK_MAX	(__NFTA_SECMARK_MAX - 1)
 
 /* Max security context length */
-#define NFT_SECMARK_CTX_MAXLEN		256
+#define NFT_SECMARK_CTX_MAXLEN		4096
 
 /**
  * enum nft_reject_types - nf_tables reject expression reject types
Signature · 1 line
2.30.2
author maintainer
#1 lore raw

Enqueued to nf-next to address:

https://bugzilla.netfilter.org/show_bug.cgi?id=1749

Quoted 25 lines · Pablo Neira Ayuso

secmark context is artificially limited 256 bytes, rise it to 4Kbytes.

Fixes fb961945457f ("netfilter: nf_tables: add SECMARK support")
---
 include/uapi/linux/netfilter/nf_tables.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/netfilter/nf_tables.h +1 -1
index aa4094ca2444..639894ed1b97 100644
@@ -1376,7 +1376,7 @@ enum nft_secmark_attributes {
 #define NFTA_SECMARK_MAX	(__NFTA_SECMARK_MAX - 1)
 
 /* Max security context length */
-#define NFT_SECMARK_CTX_MAXLEN		256
+#define NFT_SECMARK_CTX_MAXLEN		4096
 
 /**
  * enum nft_reject_types - nf_tables reject expression reject types
Signature · 1 line
2.30.2
#2 lore raw
Quoted 4 lines · Pablo Neira Ayuso

Enqueued to nf-next to address:

https://bugzilla.netfilter.org/show_bug.cgi?id=1749

Thanks Pablo!

Quoted 24 lines · Pablo Neira Ayuso
Quoted 23 lines

secmark context is artificially limited 256 bytes, rise it to 4Kbytes.

Fixes fb961945457f ("netfilter: nf_tables: add SECMARK support")
---
 include/uapi/linux/netfilter/nf_tables.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/netfilter/nf_tables.h +1 -2
index aa4094ca2444..639894ed1b97 100644
@@ -1376,7 +1376,7 @@ enum nft_secmark_attributes {
 #define NFTA_SECMARK_MAX     (__NFTA_SECMARK_MAX - 1)
 
 /* Max security context length */
-#define NFT_SECMARK_CTX_MAXLEN               256
+#define NFT_SECMARK_CTX_MAXLEN               4096
 
 /**
  * enum nft_reject_types - nf_tables reject expression reject types
--

2.30.2

Signature · 1 line
paul-moore.com