From: Pablo Neira Ayuso Date: Tue, 3 Aug 2021 23:27:19 +0000 (+0200) Subject: netfilter: nfnetlink_hook: use the sequence number of the request message X-Git-Tag: v5.14-rc6~21^2~39^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3d9bbaf6c5416bfc50f014ce5879c8c440aaa511;p=users%2Fdwmw2%2Flinux.git netfilter: nfnetlink_hook: use the sequence number of the request message The sequence number allows to correlate the netlink reply message (as part of the dump) with the original request message. The cb->seq field is internally used to detect an interference (update) of the hook list during the netlink dump, do not use it as sequence number in the netlink dump header. Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem") Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c index e0ff2973fd14c..7b0d4a3174573 100644 --- a/net/netfilter/nfnetlink_hook.c +++ b/net/netfilter/nfnetlink_hook.c @@ -264,7 +264,8 @@ static int nfnl_hook_dump(struct sk_buff *nlskb, ops = nf_hook_entries_get_hook_ops(e); for (; i < e->num_hook_entries; i++) { - err = nfnl_hook_dump_one(nlskb, ctx, ops[i], cb->seq); + err = nfnl_hook_dump_one(nlskb, ctx, ops[i], + cb->nlh->nlmsg_seq); if (err) break; }