Commit 78e7653d authored by Fernando Fernandez Mancera's avatar Fernando Fernandez Mancera Committed by Greg Kroah-Hartman
Browse files

netfilter: nfnetlink: reset nlh pointer during batch replay



[ Upstream commit 09efbac9 ]

During a batch replay, the nlh pointer is not reset until the parsing of
the commands. Since commit bf2ac490 ("netfilter: nfnetlink: Handle
ACK flags for batch messages") that is problematic as the condition to
add an ACK for batch begin will evaluate to true even if NLM_F_ACK
wasn't used for batch begin message.

If there is an error during the command processing, netlink is sending
an ACK despite that. This misleads userspace tools which think that the
return code was 0. Reset the nlh pointer to the original one when a
replay is triggered.

Fixes: bf2ac490 ("netfilter: nfnetlink: Handle ACK flags for batch messages")
Signed-off-by: default avatarFernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dc1a4813
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment