Thread View: linux.kernel.netdev
5 messages
5 total messages
Started by Yingjie Wang
Mon, 23 Nov 2026 09:04
[PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Author: Yingjie Wang
Date: Mon, 23 Nov 2026 09:04
Date: Mon, 23 Nov 2026 09:04
65 lines
20727 bytes
20727 bytes
The TCP Fast Open and MPTCP blackhole timeout calculations can wrap in 32-bit unsigned arithmetic, even on 64-bit kernels. With HZ=1000 and a 64-fold backoff, 67109 seconds becomes 8.7 seconds instead of about 50 days. Compute both delays in u64, cap them at MAX_JIFFY_OFFSET, and limit both initial timeout sysctls to one day. The new input limits reject values that were previously accepted, so this series remains for net-next and is not intended for stable. Changes since v3: - Drop the Fixes tags from both patches. - Leave the existing comments unchanged, as requested by Matthieu. - Combine the MPTCP arithmetic fix and input limit into one patch. - Name the MPTCP limit one_day_secs, as in TCP. - Drop Gang Yan's Reviewed-by from the combined MPTCP patch because the added input limit was outside the patch he reviewed. Keep Eric's Suggested-by for the MPTCP input limit. - Add Kuniyuki's Suggested-by for requesting a limit on the TCP sysctl. - Move the test notes out of the commit messages, as requested by Eric. - Rebase on net-next eb6d6c80d354. v3: https://lore.kernel.org/r/cover.1794847474.git.x-professor@outlook.com v2: https://lore.kernel.org/r/cover.1794672619.git.x-professor@outlook.com v1: https://lore.kernel.org/r/cover.1794325665.git.x-professor@outlook.com Testing on v4 and its unmodified base, x86-64, HZ=1000: - Loopback reproducers induced 12 blackholes with a 67109 second timeout and opened another connection 10 seconds later. The base kernel retried active TFO and MP_CAPABLE; v4 kept both disabled. Both probes completed using TCP on v4. - Both sysctls accepted 0, 1, 3600, 86399 and 86400, and rejected negative and above-limit values with EINVAL without changing the stored value. These checks passed in the initial and a new network namespace, with unchanged defaults and independent namespace values. - The affected objects built at each commit on x86-64 and i386 with W=1 and KCFLAGS=-Werror. The 32-bit cap was checked by compilation and arithmetic, not at runtime. The TCP and MPTCP selftests were not run locally. Yingjie Wang (2): tcp: avoid wrapping Fast Open blackhole timeout mptcp: avoid wrapping blackhole timeout Documentation/networking/ip-sysctl.rst | 1 + Documentation/networking/mptcp-sysctl.rst | 1 + net/ipv4/sysctl_net_ipv4.c | 1 + net/ipv4/tcp_fastopen.c | 4 +++- net/mptcp/ctrl.c | 6 +++++- 5 files changed, 11 insertions(+), 2 deletions(-) base-commit: eb6d6c80d35449c27471b1874f13066c09a8964d -- 2.43.0
Re: [PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Author: Eric Dumazet
Date: Mon, 23 Nov 2026 09:57
Date: Mon, 23 Nov 2026 09:57
15 lines
9993 bytes
9993 bytes
Le lun. 23 nov. 2026 ร 10:34, Yingjie Wang <x-professor@outlook.com> a รฉcrit : > > The TCP Fast Open and MPTCP blackhole timeout calculations can wrap in > 32-bit unsigned arithmetic, even on 64-bit kernels. With HZ=1000 and a > 64-fold backoff, 67109 seconds becomes 8.7 seconds instead of about > 50 days. > > Compute both delays in u64, cap them at MAX_JIFFY_OFFSET, and limit both > initial timeout sysctls to one day. The new input limits reject values > that were previously accepted, so this series remains for net-next and > is not intended for stable. Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Re: [PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Author: Joel Granados
Date: Mon, 23 Nov 2026 10:15
Date: Mon, 23 Nov 2026 10:15
103 lines
12743 bytes
12743 bytes
--nvwv6tlythhjs2jv Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound MIME-Version: 1.0 On Mon, Nov 23, 2026 at 09:04:32AM +0000, Yingjie Wang wrote: > The TCP Fast Open and MPTCP blackhole timeout calculations can wrap in > 32-bit unsigned arithmetic, even on 64-bit kernels. With HZ=3D1000 and a > 64-fold backoff, 67109 seconds becomes 8.7 seconds instead of about > 50 days. >=20 > Compute both delays in u64, cap them at MAX_JIFFY_OFFSET, and limit both > initial timeout sysctls to one day. The new input limits reject values > that were previously accepted, so this series remains for net-next and > is not intended for stable. >=20 > Changes since v3: >=20 > - Drop the Fixes tags from both patches. > - Leave the existing comments unchanged, as requested by Matthieu. > - Combine the MPTCP arithmetic fix and input limit into one patch. > - Name the MPTCP limit one_day_secs, as in TCP. > - Drop Gang Yan's Reviewed-by from the combined MPTCP patch because the > added input limit was outside the patch he reviewed. Keep Eric's > Suggested-by for the MPTCP input limit. > - Add Kuniyuki's Suggested-by for requesting a limit on the TCP sysctl. > - Move the test notes out of the commit messages, as requested by Eric. > - Rebase on net-next eb6d6c80d354. >=20 > v3: https://lore.kernel.org/r/cover.1794847474.git.x-professor@outlook.com > v2: https://lore.kernel.org/r/cover.1794672619.git.x-professor@outlook.com > v1: https://lore.kernel.org/r/cover.1794325665.git.x-professor@outlook.com >=20 > Testing on v4 and its unmodified base, x86-64, HZ=3D1000: >=20 > - Loopback reproducers induced 12 blackholes with a 67109 second timeout > and opened another connection 10 seconds later. The base kernel > retried active TFO and MP_CAPABLE; v4 kept both disabled. Both probes > completed using TCP on v4. > - Both sysctls accepted 0, 1, 3600, 86399 and 86400, and rejected negative > and above-limit values with EINVAL without changing the stored value. > These checks passed in the initial and a new network namespace, with > unchanged defaults and independent namespace values. > - The affected objects built at each commit on x86-64 and i386 with > W=3D1 and KCFLAGS=3D-Werror. >=20 > The 32-bit cap was checked by compilation and arithmetic, not at runtime. > The TCP and MPTCP selftests were not run locally. >=20 > Yingjie Wang (2): > tcp: avoid wrapping Fast Open blackhole timeout > mptcp: avoid wrapping blackhole timeout >=20 > Documentation/networking/ip-sysctl.rst | 1 + > Documentation/networking/mptcp-sysctl.rst | 1 + > net/ipv4/sysctl_net_ipv4.c | 1 + > net/ipv4/tcp_fastopen.c | 4 +++- > net/mptcp/ctrl.c | 6 +++++- > 5 files changed, 11 insertions(+), 2 deletions(-) >=20 >=20 > base-commit: eb6d6c80d35449c27471b1874f13066c09a8964d > --=20 > 2.43.0 >=20 FYI: there is a fix for the conversion between jiffies and ms for sysctl entries that just got merged [1] & [2]. It seems like what you are doing here is orthogonal to that patch. I'm flagging it in case I have misread. Best [1] https://lore.kernel.org/all/179531116414.1248683.10418563467755811748.p= r-tracker-bot@kernel.org [2] https://lore.kernel.org/all/20261118-lklm-sysctl-jiffie-ms-conv-v1-1-bb= 60e5101418@kernel.org --nvwv6tlythhjs2jv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEErkcJVyXmMSXOyyeQupfNUreWQU8FAmsEEi8ACgkQupfNUreW QU/ZRwv/Rk4eIcWA8V+uaZQwkww2UpSZ+dkTzNRytyEMs5tQ2KSdY8sSDtL5qhnF BH6GGMd2HESF/O2jEWIBWOWcUk0gMJ7QXfCakE6diUQZCYCpZxnNAUe9f3G12kBI YEPkAL1daxPu3650QorNg+HEnIaFbn5WM2l0566/xfIYJX9Powz689wobQE9GDJo gjt0hhRBYVVwdV+G1rkiujkV/1VHeVw8ErDlcYiFOz9S0dNFFLqxcy51IyFy6VFd MNVxC6u0MSV45gS5uI4/D7JpVahWCR/ap0tidK9jXHXxAiEV1Xph0zlv1FC5aId/ Ehv+PT4FDGyGLDzhtadCzJ6wfqwD3O8UM02BMvld3/Q2BusouUpYz3mY76wv90hG z0HFYdO0hEGjl6lvnfRS/zIWTOBfUT1CekRpoXfBvAdLnnZvFyT7p5O+82/2yKlT +6ql/qKRQfAChnUVfR2fRWw2MwMvQV+LLNWSyoGnpRRnTVgE86Z9lQylDob7gS0p Ka7UWH3j =WcIq -----END PGP SIGNATURE----- --nvwv6tlythhjs2jv--
Re: [PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Author: Matthieu Baerts
Date: Mon, 23 Nov 2026 10:18
Date: Mon, 23 Nov 2026 10:18
27 lines
12546 bytes
12546 bytes
Hi Yingjie, On 23/11/2026 10:04, Yingjie Wang wrote: > The TCP Fast Open and MPTCP blackhole timeout calculations can wrap in > 32-bit unsigned arithmetic, even on 64-bit kernels. With HZ=1000 and a > 64-fold backoff, 67109 seconds becomes 8.7 seconds instead of about > 50 days. > > Compute both delays in u64, cap them at MAX_JIFFY_OFFSET, and limit both > initial timeout sysctls to one day. The new input limits reject values > that were previously accepted, so this series remains for net-next and > is not intended for stable. Thank you for the v4, it looks good to me: Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > Changes since v3: Note for next time: you can put the ChangeLog in a "notes" section, so under "---" Cheers, Matt -- Sponsored by the NGI0 Core fund.
Re: [PATCH net-next v4 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Author: patchwork-bot+netdevbpf
Date: Mon, 30 Nov 2026 03:50
Date: Mon, 30 Nov 2026 03:50
29 lines
9173 bytes
9173 bytes
Hello:
This series was applied to netdev/net-next.git (main)
by Willem de Bruijn <willemb@google.com>:
On Mon, 23 Nov 2026 09:04:32 +0000 you wrote:
> The TCP Fast Open and MPTCP blackhole timeout calculations can wrap in
> 32-bit unsigned arithmetic, even on 64-bit kernels. With HZ=1000 and a
> 64-fold backoff, 67109 seconds becomes 8.7 seconds instead of about
> 50 days.
>
> Compute both delays in u64, cap them at MAX_JIFFY_OFFSET, and limit both
> initial timeout sysctls to one day. The new input limits reject values
> that were previously accepted, so this series remains for net-next and
> is not intended for stable.
>
> [...]
Here is the summary with links:
- [net-next,v4,1/2] tcp: avoid wrapping Fast Open blackhole timeout
https://git.kernel.org/netdev/net-next/c/bef93023805f
- [net-next,v4,2/2] mptcp: avoid wrapping blackhole timeout
https://git.kernel.org/netdev/net-next/c/2b19b98d5ea3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads