Re: [PATCH bpf] xsk: fix crash on double free in buffer pool
From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-12 15:00:10
Also in:
bpf
Hello: This patch was applied to bpf/bpf.git (master) by Daniel Borkmann [off-list ref]: On Thu, 11 Nov 2021 08:57:07 +0100 you wrote:
From: Magnus Karlsson <magnus.karlsson@intel.com> Fix a crash in the buffer pool allocator when a buffer is double freed. It is possible to trigger this behavior not only from a faulty driver, but also from user space like this: Create a zero-copy AF_XDP socket. Load an XDP program that will issue XDP_DROP for all packets. Put the same umem buffer into the fill ring multiple times, then bind the socket and send some traffic. This will crash the kernel as the XDP_DROP action triggers one call to xsk_buff_free()/xp_free() for every packet dropped. Each call will add the corresponding buffer entry to the free_list and increase the free_list_cnt. Some entries will have been added multiple times due to the same buffer being freed. The buffer allocation code will then traverse this broken list and since the same buffer is in the list multiple times, it will try to delete the same buffer twice from the list leading to a crash. [...]
Here is the summary with links:
- [bpf] xsk: fix crash on double free in buffer pool
https://git.kernel.org/bpf/bpf/c/199d983bc015
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html