]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/ipv4: swap flow ports when validating source
authorMiao Wang <shankerwangmiao@gmail.com>
Tue, 22 Jun 2021 04:24:50 +0000 (12:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:59:59 +0000 (16:59 +0200)
commitd20d69c405c6788c7431e82f233f2f59a3df25b0
tree46eccc86b0f9260d4cd357c9a0a8ec90b818ef77
parentb0f32a899629b12f18b06507ab972bf9dd7a5491
net/ipv4: swap flow ports when validating source

[ Upstream commit c69f114d09891adfa3e301a35d9e872b8b7b5a50 ]

When doing source address validation, the flowi4 struct used for
fib_lookup should be in the reverse direction to the given skb.
fl4_dport and fl4_sport returned by fib4_rules_early_flow_dissect
should thus be swapped.

Fixes: 5a847a6e1477 ("net/ipv4: Initialize proto and ports in flow struct")
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/fib_frontend.c