From nobody Thu Feb 23 10:32:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMq8c2zVtz3tK6y; Thu, 23 Feb 2023 10:32:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMq8c0jnCz3xC3; Thu, 23 Feb 2023 10:32:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:f554:7e70:9864:3229]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id BAC797213B540; Thu, 23 Feb 2023 11:32:05 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event From: tuexen@freebsd.org In-Reply-To: Date: Thu, 23 Feb 2023 11:32:05 +0100 Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <850BD1CD-82C6-4ECE-8676-EF1814798B1D@freebsd.org> References: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4PMq8c0jnCz3xC3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 23. Feb 2023, at 03:59, Gleb Smirnoff wrote: >=20 > On Thu, Feb 23, 2023 at 01:04:35AM +0000, Michael Tuexen wrote: > M> The branch main has been updated by tuexen: > M>=20 > M> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D453aa7fac9894945282bcf6ef55c9eba= aa1d7e40 > M>=20 > M> commit 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 > M> Author: Michael Tuexen > M> AuthorDate: 2023-02-23 01:01:53 +0000 > M> Commit: Michael Tuexen > M> CommitDate: 2023-02-23 01:04:17 +0000 > M>=20 > M> tcp: ensure the tcpcb is not NULL when logging an event > M> =20 > M> When calling tcp_bblog_pru() on some error paths, tp is NULL, > M> therefore handle it. >=20 > I wonder when does that happen? IMHO better fix such calls than > plug the problem here. The way I observed this was hitting https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n519 via https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n557 or https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n561 I wanted to fix the panic() before others are running into it. So I added the check for tp =3D=3D NULL as it was in = https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c?h=3Dstable/13#n= 141 I can change the code such that we just avoid calling tcp_bblog_pru() with tp =3D=3D NULL, or ensure tp !=3D NULL in all cases, which is what = I would prefer. We can chat about this in the next transport call. Best regards Michael > --=20 > Gleb Smirnoff