Commit 8971ee8b authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

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: 12f7a505 ("netfilter: add user-space connection tracking helper infrastructure")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 1710eb91
...@@ -380,10 +380,14 @@ static int ...@@ -380,10 +380,14 @@ static int
nfnl_cthelper_update(const struct nlattr * const tb[], nfnl_cthelper_update(const struct nlattr * const tb[],
struct nf_conntrack_helper *helper) struct nf_conntrack_helper *helper)
{ {
u32 size;
int ret; int ret;
if (tb[NFCTH_PRIV_DATA_LEN]) if (tb[NFCTH_PRIV_DATA_LEN]) {
return -EBUSY; size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN]));
if (size != helper->data_len)
return -EBUSY;
}
if (tb[NFCTH_POLICY]) { if (tb[NFCTH_POLICY]) {
ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]); ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment