Skip to contentSkip to conversation

netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches

PATCH New Pablo Neira Ayuso 1 participant 1 message May 28, 2021

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches

The private helper data size cannot be updated. However, updates that contain NFCTH_PRIV_DATA_LEN might bogusly hit EBUSY even if the size is the same.

Fixes 12f7a505331e ("netfilter: add user-space connection tracking helper infrastructure")
---
 net/netfilter/nfnetlink_cthelper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
net/netfilter/nfnetlink_cthelper.c +6 -2
index df58cd534ff5..5c622f55c9d6 100644
@@ -380,10 +380,14 @@ static int
 nfnl_cthelper_update(const struct nlattr * const tb[],
 		     struct nf_conntrack_helper *helper)
 {
+	u32 size;
 	int ret;
 
-	if (tb[NFCTH_PRIV_DATA_LEN])
-		return -EBUSY;
+	if (tb[NFCTH_PRIV_DATA_LEN]) {
+		size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN]));
+		if (size != helper->data_len)
+			return -EBUSY;
+	}
 
 	if (tb[NFCTH_POLICY]) {
 		ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]);
Signature · 1 line
2.30.2