Re: [PATCH mptcp-net v2] selftests: mptcp: fix an UAF in mptcp_connect.c

Matthieu Baerts <[email protected]>
Newsgroups dev.linux.lists.mptcp
Organization NGI0 Core
Message-ID <[email protected]>
Hi Gang,

On 14/08/2026 16:15, Gang Yan wrote:
> From: Gang Yan <[email protected]>
> 
> At the end of 'sock_connect_mptcp()', it calls 'freeaddrinfo(addr)',
> the 'peer' pointer (which points into 'addr') remains. Later, the main
> loop uses this peer pointer for reconnection attempts. If the memory has
> been freed and reused, the address data could be overwritten, resulting
> in an invalid remote address.
> 
> This patch keeps the addrinfo list allocated for the whole process
> lifetime so "peer" remains valid across reconnects; the memory will be
> released at exit() time.
Thank you for this fix!

Now in our tree:

New patches for t/upstream-net and t/upstream:
- 2596006d5efd: selftests: mptcp: fix an UAF in mptcp_connect.c
- Results: 52bf6f574345..e717f03d4d29 (export-net)
- Results: 55a0274d38e1..9262805f6805 (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/dd8ec2cb0769c4609f78e605a00117448970247c/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/19c6bf13fd58c0d98668764de2f3d68d975685c9/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.