netfilter: xt_SECMARK: add new revision to fix structure layout
Subsystems (3)
Phil Sutter
reviewerPATCH 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.
---
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
@@ -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
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")Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Phil Sutter <[email protected]>