netfilter: nfnetlink: Initialise extack before use in ACKs

Add missing extack initialisation when ACKing BATCH_BEGIN and BATCH_END.

Fixes: bf2ac490d2 ("netfilter: nfnetlink: Handle ACK flags for batch messages")
Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Donald Hunter 2024-08-06 16:43:24 +01:00 committed by Pablo Neira Ayuso
parent 3cd740b985
commit d1a7b382a9

View File

@ -427,8 +427,10 @@ replay_abort:
nfnl_unlock(subsys_id);
if (nlh->nlmsg_flags & NLM_F_ACK)
if (nlh->nlmsg_flags & NLM_F_ACK) {
memset(&extack, 0, sizeof(extack));
nfnl_err_add(&err_list, nlh, 0, &extack);
}
while (skb->len >= nlmsg_total_size(0)) {
int msglen, type;
@ -577,6 +579,7 @@ done:
ss->abort(net, oskb, NFNL_ABORT_NONE);
netlink_ack(oskb, nlmsg_hdr(oskb), err, NULL);
} else if (nlh->nlmsg_flags & NLM_F_ACK) {
memset(&extack, 0, sizeof(extack));
nfnl_err_add(&err_list, nlh, 0, &extack);
}
} else {