Date: Thu, 23 Feb 2023 11:32:05 +0100 From: tuexen@freebsd.org To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event Message-ID: <850BD1CD-82C6-4ECE-8676-EF1814798B1D@freebsd.org> In-Reply-To: <Y/bWrQbl6AC6xdYW@FreeBSD.org> References: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> <Y/bWrQbl6AC6xdYW@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 23. Feb 2023, at 03:59, Gleb Smirnoff <glebius@FreeBSD.org> 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 <tuexen@FreeBSD.org> > M> AuthorDate: 2023-02-23 01:01:53 +0000 > M> Commit: Michael Tuexen <tuexen@FreeBSD.org> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?850BD1CD-82C6-4ECE-8676-EF1814798B1D>