From nobody Thu Feb 23 01:04:35 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 4PMZYb2FwDz3sjDS; Thu, 23 Feb 2023 01:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMZYb1mhSz45f6; Thu, 23 Feb 2023 01:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677114275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxsJfJonMk/7ACitNX0g8fHnny9wmHbexptSnrUjIic=; b=MYRR3iqIXqdc8wmgx5ZnIctI0fhyC3nVwzJSC2pDu2DrF0bN9S8UE2aumOQDnXsZZ4b/gE Nxeaw0rw4zAaZuoF9bXhcn0HB4nii35rbqdE44r1bew6k/PYrgmzlgw/X+E2iuFMeyBfJB Ph8gFWR6RLlOZClmPaaHKCkChcyxQTJrda0mx0z/xA5YIcrmvRIsChfRjvV79JAQ1bNake wmBB5R6pEQj+RD03EX9Hbz/utgQzZ/67Sdt0NP3hqac25F5Uogdr319g5Xga/JVVM+FThr 8vO5TPhBJZQWeCAZJmbmZx770sYjx5Mzo0/iDZOjdWaPrYNwI+ZoTWySVAjcrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677114275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxsJfJonMk/7ACitNX0g8fHnny9wmHbexptSnrUjIic=; b=YoS651sXsZReSs+zX4bQsbWFsygJblaRBerShNlUB9JyUirR2ua0arKftBbuv10J/hc4fB /sH64TBnKRFFB+7RF1jyfsJ5xRWjsXISG01dp+ym8zG/5XPXqBU6G4v0OQX2+Hz8CmItJ3 DdfgGojcVOtOYHtVbUJE9R2nrq+rmfyhjJmdyizoRfca5pAB/YIVJRlatOEtP38+CIiXmD jZQaATDxokQU9aX1tbZJmcTJk4l8VE47ZKZJhiEnVuOvsgTYa6hpxQkPjNifoKjP1B1HoC xF72fdr7n82d+XD+L5g020mG0GAhOoRSCIo+ZOX9TS9EHCls3rcvH43qv9ZBnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677114275; a=rsa-sha256; cv=none; b=IeulXHeb5gBJ3hJUMIEWeO8lOe5xWqNfsvG+6wj526BogLSRbj9y3ooz5X6vdmcg+Qmi67 YTAJdgtDl0N7ONcjmjCqU6YHTUC2wb3VAsJa06bfKkYWkn5HW+eiECG/SBOrp9Cn01Fcr2 Ik4IZZayQnvRV4LvNPaXHwW+IC4rUAsK8MN6aqp1gwkuy7SSR1gM3isqwZixoAnzlf/w4C kyTHfDcZRt5rfx3PcGcoGkOBrjprjhfoT4CnsnwCaRVEDpR1n/BPhNL9uyt6UQiYqNwVW7 JQJubsF4nshae7ufpkfnz6QjMesfGShlQDsmjWg52eqWRRFmaiMkb1xmAbLqHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMZYb0qhvzNLX; Thu, 23 Feb 2023 01:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31N14ZiK029778; Thu, 23 Feb 2023 01:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N14Z9h029777; Thu, 23 Feb 2023 01:04:35 GMT (envelope-from git) Date: Thu, 23 Feb 2023 01:04:35 GMT Message-Id: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 commit 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 Author: Michael Tuexen AuthorDate: 2023-02-23 01:01:53 +0000 Commit: Michael Tuexen CommitDate: 2023-02-23 01:04:17 +0000 tcp: ensure the tcpcb is not NULL when logging an event When calling tcp_bblog_pru() on some error paths, tp is NULL, therefore handle it. Sponsored by: Netflix, Inc. --- sys/netinet/tcp_usrreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 878e5095eef2..f17285664ce5 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -136,6 +136,9 @@ tcp_bblog_pru(struct tcpcb *tp, uint32_t pru, int error) { struct tcp_log_buffer *lgb; + if (tp == NULL) { + return; + } INP_WLOCK_ASSERT(tptoinpcb(tp)); if (tp->t_logstate != TCP_LOG_STATE_OFF) { lgb = tcp_log_event_(tp, NULL, NULL, NULL, TCP_LOG_PRU, error,