Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak in kernel space because the memory registered by IPV6_ADD_MEMBERLAND is not released #228

Open
xdbob opened this issue Feb 15, 2024 · 1 comment · May be fixed by #229
Open

Comments

@xdbob
Copy link

xdbob commented Feb 15, 2024

Related-To: #177

When an interface is deleted IPV6_DROP_MEMBERSHIP is not called leaking mc memory in kernel making radvd fail to send RA on new interfaces with the following errors:

sendmsg: No buffer space available
can't join ipv6-allrouters on tap1
can't join ipv6-allrouters on tap1
can't join ipv6-allrouters on tap1
[...]

The following script reproduces the issue:

#!/bin/bash

IFNAME=tap1

for i in {1..1000}; do
	echo "Iteration: $i"
	echo "Creating tap..."
	ip tuntap add mode tap ${IFNAME}
	ip link set ${IFNAME} up
	
	echo "Spawning qemu..."
	# radvd waits 1 second by default before joining the multicast group
	timeout 1.5 qemu-system-x86_64 -boot n -net nic -net tap,ifname=${IFNAME},script=no,downscript=no -nographic
	
	echo "Removing tap..."
	ip link delete ${IFNAME}
done

with the following config file:

interface tap1 {
        IgnoreIfMissing on;
        AdvSendAdvert on;
        AdvManagedFlag on;
        AdvOtherConfigFlag on;
};

Note: on our kernel the issue happens on about ~366 iterations with the following config:

$ sysctl net.core.optmem_max
net.core.optmem_max = 20480
@xdbob xdbob linked a pull request Feb 15, 2024 that will close this issue
@Neustradamus
Copy link
Member

@robbat2: Have you seen this issue and the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants