xfrm and fwmark do not work on VXLAN xmit

Bug #1540886 reported by Atzm Watanabe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Low
Unassigned

Bug Description

On Ubuntu 15.04, kernel 3.19.0-49-generic has known issue that xfrm and fwmark do not work on VXLAN xmit.
This issue was fixed on upstream kernel: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=239fb791d4ee194740e69fe9694f58ec404d1689

I think the above patch should be backported because this may cause serious problems including security issues.
For example, outgoing VXLAN packet will be sent without encryption even if IPsec security policy is configured properly.
As the result, the packet which should be encrypted can be snooped.

How to reproduce:

When using ipsec-tools (for minimum reproducing steps):

--- Node-A
# modprobe esp4
# modprobe af_key
# modprobe xfrm4_mode_transport
# setkey -c <<EOL
> flush;
> spdflush;
> add <Node-A> <Node-B> esp 0x201 -E 3des-cbc 0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831;
> add <Node-B> <Node-A> esp 0x301 -E 3des-cbc 0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df;
> spdadd <Node-A> <Node-B> udp -P out ipsec esp/transport//require;
> spdadd <Node-B> <Node-A> udp -P in ipsec esp/transport//require;
> EOL
# ip link add vxlan100 type vxlan id 100 remote <Node-B>
# ip addr add 1.1.1.1/24 dev vxlan100
# ip link set vxlan100 up

--- Node-B
# modprobe esp4
# modprobe af_key
# modprobe xfrm4_mode_transport
# setkey -c <<EOL
> flush;
> spdflush;
> add <Node-A> <Node-B> esp 0x201 -E 3des-cbc 0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831;
> add <Node-B> <Node-A> esp 0x301 -E 3des-cbc 0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df;
> spdadd <Node-B> <Node-A> udp -P out ipsec esp/transport//require;
> spdadd <Node-A> <Node-B> udp -P in ipsec esp/transport//require;
> EOL
# ip link add vxlan100 type vxlan id 100 remote <Node-A>
# ip addr add 1.1.1.2/24 dev vxlan100
# ip link set vxlan100 up
# ping 1.1.1.1

Then packets which is encapsulated with VXLAN header will be shown in tcpdump, but they must be ESP packets.

Atzm Watanabe (atzm)
affects: apport (Ubuntu) → linux-lts-vivid (Ubuntu)
Revision history for this message
penalvch (penalvch) wrote :

Atzm Watanabe, thank you for reporting this and helping make Ubuntu better.

As per https://wiki.ubuntu.com/Releases, Ubuntu 15.04 is EOL as of February 4, 2016.

Is this reproducible with a supported release?

affects: linux-lts-vivid (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Atzm Watanabe (atzm) wrote :

Hi,

Thank you for the reply.

This problem can be reproduced on 14.04 LTS (3.13.0-76-generic).
But because the bug has fixed in upstream kernel since 4.2, the problem is not caused on 15.10 (4.2.0-30-generic).
I have not try to reproduce on 12.04 LTS yet, but if the kernel version is earlier than 4.2, the problem will be reproduced probably.

Revision history for this message
penalvch (penalvch) wrote :

Atzm Watanabe, to advise, Trusty would have this fix available via the enablement kernel as outlined in https://wiki.ubuntu.com/Kernel/LTSEnablementStack .

Despite this, would you need a backport to a release prior to Wily?

If not, please mark this Status Invalid.

Revision history for this message
Atzm Watanabe (atzm) wrote :

Thank you for the advice.
I tried LTS Enablement Stack (linux-image-generic-lts-wily) and it worked fine to me.
So I don't need a backport. I mark the issue status Invalid.

Thank you again!

Changed in linux (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.