From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796438559; b=RGyTRd8bVCLED1IqrDuva86RcwSqx6b3N96YFzsRs6j+3EVfJuHMs3p0wjtl68W4O1jc Yrjdiq/2hQsCQeFhTcBccqIzaA+V7Wwx8pO7DQ5p4sMgWO3jv+9b50oVHnU2M46s7YxAA DuhBGlDE4TILSWa2nNbE/8HIdVGAxb88+5aBsLfomyjmDetANC/iztBhl41juTnh9q6jG CjIK+GimaaYzOziW5gDVm/MoF7gPofaMfbmY8wjRT0wWIkkrnPZk8PaQeSqaJ6omDuiFj uujGsbdsGKiZOSvRSWdE6NQBA5Y5esEWK0Ery1kNLZ7JezNllMEdHFBKNV7+46U7Ddg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796438559; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=yBqUVPyp6AZLzdcyP2KCqNU/lyuC1GR1JOhr0IW8W2U=; b=bgXyeXGSY23FFyxNKcyNfrqWkWVLrPlOC93wOl1CSjSEuLBH1BE2Hy0ekGRb7K+ZeP48 x4uKhA2xCGcSSLQ45quJ8qaeROEZXiJkgWiCc4r4CBjhjSwKdNx2ypB2f2IPgoENGoSgl HBIDRL3dua+Wo5IqAeJ2JJjdY1ilVlwsQBAL9ph850+TN5ux7XGtJTts7jG7mzaWSVtBr JbfHUGbxlLrG1elavAMYgFM0os5PqoYCRVjqxKE4X6N/flCPbjuTWVR9Vkf3vrU4nwRZL 6HV7J1du2+NaS/vRHEaO39HF0kahv8UPlGorDX3Tk/VvLH8qW1oaB3KJ6NrtzU+r46w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--kuniyu.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NXMwYbAJ; arc=none smtp.remote-ip=209.85.210.197 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2B2606A322 for ; Sat, 5 Dec 2026 02:42:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C2B2606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kuniyu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=NXMwYbAJ Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8dce0e7a873so1635495b3a.2 for ; Fri, 04 Dec 2026 18:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796438558; x=1797043358; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yBqUVPyp6AZLzdcyP2KCqNU/lyuC1GR1JOhr0IW8W2U=; b=NXMwYbAJ37SBL1zOBQWVms3K7msSizvKIfIHzFGWN7018rmearJDP7IDUeBZAiezQB siyLB5oiWYjDjfB5Kx7OZ5nN4U3lUkwSnmyXWOxMPVdGBcZ7wWjNSI8Q+qd9Hs8k4m4w pc4HKFttTSl9h98JbgtSkUEtTnChNlq1LyDHl4MOQWoKhBt1Wjtys6j9YIQ4+nAd1yXl 8lqSn9DFo2Jj+CqeYy7VtDXOpyuOhw/ImaViY6xherwRulNuaAWzBayMxg3hhOHlIjmk 2ALKWEpfrNASnY0Ey9UHAJgKYTpUQ3PlmVOcgMjbQlG88791haFULPLZLrwh0iKR8Aop pbyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796438558; x=1797043358; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yBqUVPyp6AZLzdcyP2KCqNU/lyuC1GR1JOhr0IW8W2U=; b=w+2F3As6Gx6vRfgyOajMsQbNklH6N6rcT5HdDnjuZpWRzeDBDUy2yaHDKtECB7UqqI j7N3buGnu7IyPFyximsJBYRprpDO9feGM1ge7l3+eFTbqjUwh/lit8DNjUMCOavyAkqi 1ag+NsqWcgzuraxAshJ/2z9AfiPALGFjgc0BhRu8VoL1oPfjmZDf0I3i2qJgrFNHUxPJ jdYb2jZbuVge2lLe2A/f+uZdqeZsZb7d2S2/T2uZuOjTRGT9crVCNPEJRq+ynO3IlsBi wShUnGsTm6z17nOtBwHaE+oPI5z+XuUctUB6hWOO3r84yZsC1pUWsyDTF/rQMvNS3wOX kFtQ== X-Forwarded-Encrypted: i=1; AL+hErHgahumJ6k94GHULL4RNJm09fR+Fk9yE1Tty2E8k7Y373TLREB1heYsPtLoBHlua1qBmVJdYYc=@vger.kernel.org X-Gm-Message-State: APuU4Z+BqrXFvFP68J0Scz9kFDMbPRIxizVzAjwVkALQb1KWKTNq28uV TXSAZ46B+dMdLKto2gwxQBFjvEaqSmF95Dth+YrF2dYEKo0oWCFkRAawVnnmEGJDa0ktcabqbGs xxzqWFg== X-Received: from pfbf10.prod.google.com ([2002:a05:6a00:ad8a:b0:8dc:c8f6:c5b4]) (user=kuniyu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:298f:b0:8c9:4ad:abec with SMTP id d2e1a72fcca58-8de2cd4aa7emr3369984b3a.29.1796438558172; Fri, 04 Dec 2026 18:42:38 -0800 (PST) Date: Sat, 5 Dec 2026 11:42:37 +0900 In-Reply-To: <20261203202930.14580-1-mason@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261203202930.14580-1-mason@kernel.org> Message-ID: Subject: Re: [PATCH net] tcp: clamp the u64 delta in tcp_rcv_rtt_measure() From: Kuniyuki Iwashima To: Chris Mason Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, willemb@google.com, josef@bacik.io, netdev@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, 03 Dec 2026 15:45:36 -0500, Chris Mason wrote: > TCP autotuning can leave the receive buffer too small if the sender > takes more than 71 minutes to fill a receive window. > > tcp_rcv_rtt_measure() uses that time as an RTT sample, but truncates it > to u32 before tcp_rcv_rtt_update() clamps it: > > tcp_mstamp - rcv_rtt_est.time = 4295000000 us > (u32)4295000000 = 32704 us > min(32704, TCP_RTT_MAX_US) = 32704 us > > Without TCP timestamps, autotuning keeps the smallest sample as its RTT > estimate for the rest of the connection. > > The fix used here is to clamp the sample while it is still a u64. > > Found by LLM code inspection, and confirmed with LLM generated > reproducers on an unmodified kernel. Fixed by LLM, and tested with > the reproducers and existing kernel selftests. > > Fixes: 645f4c6f2ebd ("tcp: switch rcv_rtt_est and rcvq_space to high resolution timestamps") > Signed-off-by: Chris Mason Reviewed-by: Kuniyuki Iwashima