From patchwork Fri Sep 6 17:23:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1981989 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 4X0jlg22SJz1y1H for ; Sat, 7 Sep 2024 03:24:47 +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 1smchL-0003Lo-HY; Fri, 06 Sep 2024 17:24:39 +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 1smchK-0003LV-OA for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2024 17:24:38 +0000 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (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 93C503F129 for ; Fri, 6 Sep 2024 17:24:38 +0000 (UTC) Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-82aa3526f4eso1645339f.2 for ; Fri, 06 Sep 2024 10:24:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725643477; x=1726248277; 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=3uMlQyTnikP+E3B6ziX9PTolQ542mvvzMHpO5tkSA1A=; b=kizjFLGr4KUqQHHXv53F8Col5JKNXoB/XwagQJoXJ42mYtSFGEo5FR+7zI5fM/C0ue CaPP/0UorBsDVrsTp3m5SVooUQqghnLz5oQS1vs/WMIkOL0zfhBp08ne4HrchsYyVQeC qk7zIjhEpUM1MeUC2FKAP7uDb/0LBNswod3PniFbg/Hi0eR4z9EStukei9y7M/nGWIHF SCrhF1x4v69sYmT65/WiF07lMjNIRSIfpDBHG4kdFFUXaJlV1g1EQ99iP6Tef+nftcJv SYTzbQ7536Npj+x96XHlU1TSoRxFn75iRr173w4UdmnwhIcCNu8gPL7LEwJcWoZiOCv4 /+Hw== X-Gm-Message-State: AOJu0YzwhG7p2ExMyB9r3y+L4biZbkTtXZc0WdtPdWSY6htvJCDYJXPp UvPT/udLGe4elkn86JBIrzwXlQY/lbSqHh9c2jHMSbqpEyt3R1JudeV2oIWbEbOl8x4InFNocVR 0axEXAYOa+q17GlDYBS+CTdp/lk8bOQYYvIbrWEDLIVUpn7jvCM10SLKmo0SkKRoInPIvG5nJ4a 8wUXf7f6SmqPEy X-Received: by 2002:a6b:fc16:0:b0:81f:86e1:5a84 with SMTP id ca18e2360f4ac-82a9620e999mr194480939f.2.1725643477372; Fri, 06 Sep 2024 10:24:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwy4xTipLWCPx0yWvreMSamoDz6iDCRTtWee5opPPQMSBpOBxYn2XefHjGpsNhTzzx7qZrxQ== X-Received: by 2002:a6b:fc16:0:b0:81f:86e1:5a84 with SMTP id ca18e2360f4ac-82a9620e999mr194479139f.2.1725643476884; Fri, 06 Sep 2024 10:24:36 -0700 (PDT) Received: from smtp.gmail.com (209-50-27-115.lnk02.ne.dynamic.allophone.net. [209.50.27.115]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2de5cf8sm4139773173.37.2024.09.06.10.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 10:24:36 -0700 (PDT) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH v2 1/1] UBUNTU: SAUCE: fix NULL ptr deref causing system crash Date: Fri, 6 Sep 2024 12:23:47 -0500 Message-Id: <20240906172347.17439-2-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240906172347.17439-1-bethany.jamison@canonical.com> References: <20240906172347.17439-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/bugs/2077657 Fix bug LP#2077657 where an issue with tracking packets is causing a NULL pointer dereference that causes system crashes. This solution was proposed by Josh Hunt in the bug ticket he submitted. 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; }