* XFRM with bridged packets problem
@ 2020-01-29 9:39 Noel Kuntze
0 siblings, 0 replies; only message in thread
From: Noel Kuntze @ 2020-01-29 9:39 UTC (permalink / raw)
To: netdev, steffen.klassert, davem
[-- Attachment #1.1: Type: text/plain, Size: 1310 bytes --]
Hello List, Steffen, Dave,
I have found a bug in XFRM/The IPv4 network stack.
Reproduced on 4.19.99 lts and 5.4.15.
Following my notes to the problem:
XFRM docker issue
================
Topology:
docker container with veth pair attached to docker0.
docker0 address 172.17.0.1, container address 172.17.0.2
IPsec policy based tunnel from 172.16.20.2/32 to 0.0.0.0/0
Passthrough policies for multicast, 172.17.0.0/16 to 172.17.0.0/16,
no matching policy for 172.17.0.2 == 0.0.0.0/0
Packets are sent through tunnel regardless
Packets with wrong source IP can be observed on other IPsec peer, traffic counters of incoming SA increases; One endpoint is on the internet, no shared link.
Naturally, the packets are dropped when they're received by the other peer because the policy doesn't match the negotiated policies don't match the packets.
After adding an SNAT rule on the docker host to change the packets' source address to 172.16.20.2, they match the policies on the server and make it onwards. Before then "XfrmInNoPols" in /proc/self/net/xfrm_stat is increased for every packet.
Please let me know what you think.
Kind regards
Noel
--
Noel Kuntze
IT security consultant
GPG Key ID: 0x0739AD6C
Fingerprint: 3524 93BE B5F7 8E63 1372 AF2D F54E E40B 0739 AD6C
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-29 9:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-29 9:39 XFRM with bridged packets problem Noel Kuntze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox