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: > > On Thu, Feb 23, 2023 at 01:04:35AM +0000, Michael Tuexen wrote: > M> The branch main has been updated by tuexen: > M> > M> URL: https://cgit.FreeBSD.org/src/commit/?id=453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 > M> > 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> > M> tcp: ensure the tcpcb is not NULL when logging an event > M> > M> When calling tcp_bblog_pru() on some error paths, tp is NULL, > M> therefore handle it. > > 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 == NULL as it was in https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c?h=stable/13#n141 I can change the code such that we just avoid calling tcp_bblog_pru() with tp == NULL, or ensure tp != NULL in all cases, which is what I would prefer. We can chat about this in the next transport call. Best regards Michael > -- > Gleb Smirnoff
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?850BD1CD-82C6-4ECE-8676-EF1814798B1D>
