From patchwork Tue Sep 3 20:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1980290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyxnN3CVbz1ygj for ; Wed, 4 Sep 2024 06:20:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sla0K-0002cf-RZ; Tue, 03 Sep 2024 20:19:56 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sla0I-0002c7-CB for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 20:19:54 +0000 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 893013FBC7 for ; Tue, 3 Sep 2024 20:19:48 +0000 (UTC) Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-8224c9a44dfso117524539f.1 for ; Tue, 03 Sep 2024 13:19:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725394787; x=1725999587; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9XA93e+E5KAYFUwNvFeSXumsQrKOvqdlsvxcUXy/Wlg=; b=q9nFcTeCPCycaG0vAs5Vyo1IrB1YFb26toBS6ZDQnDMPmE0jfLd17/X5j3OOjAXtbU Wg4fKobLMAQL83bTNuk/I5WuEIOvTd/L6FvSX73NT02p2ar74gazhSIfYvB6CDpd8kcK fKgVisxpGu3ST5KgS9Osz7Ylm/I9VVidXT8i0ub0e1du/hhF8tnGsMgcFPaRSxkdGg+v IeOiHCtDBVG/OoKJUZgM21dgynMGdZ1F1XqlcfDPVoGh2sXiJLBVvqtKtgw5prtcFqZ3 5lNbzNFXHwOWA4gWYBjunRJ2cFjByBIyZQ3wjX2UVoR8GyANf504RsdQM9AakvhQbLeB TaBg== X-Gm-Message-State: AOJu0Yw8iwYDzUZ3BYv64+2sRqTb61dGZq1HaYUsGIzI6UXBWmVdF8v+ RJREPXjy0aP1+rhcBFgrQsrR2IY8CfV8hUUS+4bDPBLUA7OdiDUmOOdJ7LoIGUiyqJZS5+pHBFY +yo/LaiorwCcUqJ+AFqepLxyCQ/GG7i9qKRFEM96MgmWIr2v0eDJAKu7xDSHaLUL+SfAI8WQFVE UK4YVHcxJZ1qH7 X-Received: by 2002:a6b:db0a:0:b0:80a:9c66:3842 with SMTP id ca18e2360f4ac-82a262dcc94mr925230639f.3.1725394786887; Tue, 03 Sep 2024 13:19:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4log67AZnNG2SASpojoN2y3TUGHldj84SpNq1FT/2vrhVFt6qgQC0miIxyL34OtWeX62mLw== X-Received: by 2002:a6b:db0a:0:b0:80a:9c66:3842 with SMTP id ca18e2360f4ac-82a262dcc94mr925228539f.3.1725394786347; Tue, 03 Sep 2024 13:19:46 -0700 (PDT) Received: from smtp.gmail.com (167-248-51-36.oa02.lnk04.ne.dynamic.allophone.net. [167.248.51.36]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d05da81bc9sm33251173.104.2024.09.03.13.19.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 13:19:46 -0700 (PDT) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH 1/1] fix NULL ptr deref causing system crash Date: Tue, 3 Sep 2024 15:19:03 -0500 Message-Id: <20240903201903.73774-2-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903201903.73774-1-bethany.jamison@canonical.com> References: <20240903201903.73774-1-bethany.jamison@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Buglink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2077657 Fix bug LP#2077657 where an issue with tracking packets that is causing a NULL pointer dereference that causes system crashes. Signed-off-by: Bethany Jamison --- include/net/tcp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 164ba7b77bd9f..fc8d82220e4c7 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2081,7 +2081,8 @@ static inline s64 tcp_rto_delta_us(const struct sock *sk) { const struct sk_buff *skb = tcp_rtx_queue_head(sk); u32 rto = inet_csk(sk)->icsk_rto; - u64 rto_time_stamp_us = tcp_skb_timestamp_us(skb) + jiffies_to_usecs(rto); + u64 rto_time_stamp_us = skb ? tcp_skb_timestamp_us(skb) : 0 + jiffies_to_usecs(rto); + WARN_ON_ONCE(!skb); return rto_time_stamp_us - tcp_sk(sk)->tcp_mstamp; }