From 17bec56c219cd7421424970ecc3827da5f6b9201 Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Tue, 23 Dec 2025 14:59:53 -0800 Subject: [PATCH 1/2] WSlA: Adjust default CONTAINER_PORT_RANGE to avoid dmesg warning around port range parity --- src/windows/wslaservice/exe/WSLAVirtualMachine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp index 5f8c90f22..13e1fea4e 100644 --- a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp +++ b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp @@ -32,7 +32,7 @@ constexpr auto MAX_CRASH_DUMPS = 10; constexpr auto SAVED_STATE_FILE_EXTENSION = L".vmrs"; constexpr auto SAVED_STATE_FILE_PREFIX = L"saved-state-"; constexpr auto RECEIVE_TIMEOUT = 30 * 1000; -constexpr auto CONTAINER_PORT_RANGE = std::pair(20001, 65535); +constexpr auto CONTAINER_PORT_RANGE = std::pair(20000, 65535); static_assert(c_ephemeralPortRange.second < CONTAINER_PORT_RANGE.first); From 51d9760838e27f755fad90bb318742fe45afdeb8 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:06:20 -0800 Subject: [PATCH 2/2] Fix ephemeral port range parity to eliminate kernel warning (#13976) * Initial plan * Fix port range parity warning by adjusting ephemeral range - Changed c_ephemeralPortRange from (10000, 20000) to (10000, 20001) to fix parity - 10000 is even, 20001 is odd - different parity eliminates dmesg warning - Changed CONTAINER_PORT_RANGE from (20000, 65535) to (20002, 65535) - Ensures non-overlapping ranges and static_assert passes (20001 < 20002) - Reverts incorrect change from previous commit that set it to 20000 Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Final progress update Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> --- _codeql_detected_source_root | 1 + src/shared/inc/lxinitshared.h | 2 +- src/windows/wslaservice/exe/WSLAVirtualMachine.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 000000000..945c9b46d --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/src/shared/inc/lxinitshared.h b/src/shared/inc/lxinitshared.h index b64fbf13e..b58cefa83 100644 --- a/src/shared/inc/lxinitshared.h +++ b/src/shared/inc/lxinitshared.h @@ -287,7 +287,7 @@ Module Name: // Definitions used by WSLA // -constexpr auto c_ephemeralPortRange = std::pair(10000, 20000); +constexpr auto c_ephemeralPortRange = std::pair(10000, 20001); // The types of messages that can be sent to init and mini init. // diff --git a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp index 13e1fea4e..4299187e7 100644 --- a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp +++ b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp @@ -32,7 +32,7 @@ constexpr auto MAX_CRASH_DUMPS = 10; constexpr auto SAVED_STATE_FILE_EXTENSION = L".vmrs"; constexpr auto SAVED_STATE_FILE_PREFIX = L"saved-state-"; constexpr auto RECEIVE_TIMEOUT = 30 * 1000; -constexpr auto CONTAINER_PORT_RANGE = std::pair(20000, 65535); +constexpr auto CONTAINER_PORT_RANGE = std::pair(20002, 65535); static_assert(c_ephemeralPortRange.second < CONTAINER_PORT_RANGE.first);