Skip to contentSkip to conversation

netfilter: xt_SECMARK: add new revision to fix structure layout

PATCH Applied Phil Sutter 2 participants 2 messages Apr 30, 2021 – May 3, 2021

Subsystems (3)
lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH v2 1/1 netfilter: xt_SECMARK: add new revision to fix structure layout

From: Pablo Neira Ayuso <[email protected]>

This extension breaks when trying to delete rules, add a new revision to fix this.

Fixes 5e6874cdb8de ("[SECMARK]: Add xtables SECMARK target")

---
Formal submission of this patch which I received in private. Used it to implement user space side and thereby discovered a bug:
secmark_tg_check_v1() would not populate the legacy data structure with the 'secid' value initialized in the new data structure, thereby breaking functionality for old user space.

Changes since v1:
- Choose a more suitable name for v1 data structure
- Fix name suffixes of revision-specific callbacks

---
 include/uapi/linux/netfilter/xt_SECMARK.h |  6 ++
 net/netfilter/xt_SECMARK.c                | 88 ++++++++++++++++++-----
 2 files changed, 75 insertions(+), 19 deletions(-)
include/uapi/linux/netfilter/xt_SECMARK.h +6 -0
index 1f2a708413f5d..beb2cadba8a9c 100644
@@ -20,4 +20,10 @@ struct xt_secmark_target_info {
 	char secctx[SECMARK_SECCTX_MAX];
 };
 
+struct xt_secmark_target_info_v1 {
+	__u8 mode;
+	char secctx[SECMARK_SECCTX_MAX];
+	__u32 secid;
+};
+
 #endif /*_XT_SECMARK_H_target */
net/netfilter/xt_SECMARK.c +69 -19

126 lines not on this page · raw message

Signature · 1 line
2.31.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Phil Sutter

From: Pablo Neira Ayuso <[email protected]>

This extension breaks when trying to delete rules, add a new revision to fix this.

Applied, thanks Phil.

I'm routing this through nf.git given removal of SECMARK rules is not possible, which is a bug.

Quoted 3 lines
Fixes 5e6874cdb8de ("[SECMARK]: Add xtables SECMARK target")