Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Eric Dumazet
Thu, 22 Oct 2026 12:34
Re: [PATCH net] tcp: limit tcp_tso_rtt_log to a valid shift count
Author: Eric Dumazet
Date: Thu, 22 Oct 2026 12:34
Date: Thu, 22 Oct 2026 12:34
37 lines
10004 bytes
10004 bytes
Le jeu. 22 oct. 2026 ร 14:28, Yingjie Wang <1075151112@qq.com> a รฉcrit :
>
> tcp_tso_autosize() right-shifts the u32 returned by tcp_min_rtt() by
> sysctl_tcp_tso_rtt_log. The sysctl uses proc_dou8vec_minmax() without
> an upper bound, so it accepts values through 255. Values above 31 make
> the shift undefined.
>
> A process with CAP_NET_ADMIN in the target network namespace can set the
> per-netns sysctl. With CONFIG_UBSAN_SHIFT=y, setting it to 32 and sending
> TCP data over loopback triggers:
>
> UBSAN: shift-out-of-bounds in net/ipv4/tcp_output.c:2264:30
> shift exponent 32 is too large for 32-bit type 'unsigned int'
> Call Trace:
> __ubsan_handle_shift_out_of_bounds
> tcp_tso_segs
> tcp_write_xmit
> __tcp_push_pending_frames
> tcp_push
> tcp_sendmsg_locked
>
> Limit the sysctl to 31, the largest valid shift count for a u32, and
> document the accepted range. Writes of larger values now fail with
> -EINVAL.
>
> On a UBSAN/KASAN build of the net tree, values 0 and 31 remained
> accepted, values 32 and 255 returned -EINVAL, and TCP traffic with the
> valid boundary values produced no sanitizer diagnostics.
>
> Fixes: 65466904b015 ("tcp: adjust TSO packet sizes based on min_rtt")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yingjie Wang <1075151112@qq.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
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