From nobody Wed Dec 27 16:35:43 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 4T0chJ27lKz55vvX; Wed, 27 Dec 2023 16:35:44 +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 4T0chJ025Wz3SRW; Wed, 27 Dec 2023 16:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703694944; 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=ceIzv9MwGtQ2eR50NTdXW42k86WeBi+XjID8VhKtblg=; b=pbc2GS1XhdBR/hQuuo3BdJyZ/Gk3vO4+yiT7CuIglBMGNwiSdgXujimr9wHf30zuv7CGeh NFe7lwAUSGjOl2JAkUeabALrXofaw8vF9lp5uLGYRAq+3WfmIvPzxDkHeeAIasLJ6uVTV0 MlIGEPnPQZMsTYhkSRgVJ5vqLzTzXn5cXJLwL2EX9xmZ+3mNKCYRiTRk99ZvFaRBb9uOJt FkWEoe4mRv97LR6SAwp3FRxAIdVNlY7H7lDw+RoHt4xEdKLL4wa/SrufMHt+i3EwBYKGmH IcroQrWlY9AtS7x+6P0VFodilY53SMr0JSSndSFUP2zz3HIDFExbbEXe/MMXTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703694944; a=rsa-sha256; cv=none; b=MJoer5wFGuWIsTg3XVwMaGxRcrigeCPc7iedl1l5VOAoNml9BTOIUaF/8SS+Syz7muiVEx XkqNzJFUcyNQr8/NpUhq/c5WcSkpOgh5SpvBNq7efR1gq2nQHFpdOB8o/VwpTZmd0j076l lS+PBoaDmSMC9ZAc0asEIm5+tMHpXflacUeNAd+rZnLwsnQhOIkv1sERENqXWD88nuwOUz 7sK/7PH6wzQU/T6a88WEcgto+jmhAkWYZH8N01APbFmgSqO5Nr1DilqQx9jire0q5hP+SO MWF2tIg+OF6miwYaocyH6749wehz4jdHVkT0UHWN5xX8KDQ06/8NQYE2CwoZIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703694944; 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=ceIzv9MwGtQ2eR50NTdXW42k86WeBi+XjID8VhKtblg=; b=j+39b0JJLWHZ48Am14LimTIV9+cUwjxqPpAQwOVJXM20rhzNYCd+vQ8rAFgRbhBtiSBs74 swTiEaenV0WQ+v1jsgfw/YOhcvmSVLhtjYNYWeLYRWwj5IeBH1knFYdPx43SxATdASM8pb Fe2Ligev1H+Xn+rT0N/wk00zjwxOLoltzIyJVH3bvZaFc6wVqMESykXw/Nv6tVFtSeWISC CrSd/vHYBfrgEfPHt52UIpROwKCQ1at+EEiBuLMJ4QjBt0QPkeikuNoJV918PlYdKetaLH 1QYsZpjgc5D1qUXkVACUphcrOGX3HP4QpTMalSioeEqcRZPeGuifF1D8IOJ4jg== 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 4T0chH5Cc0zmRF; Wed, 27 Dec 2023 16:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BRGZhwr081794; Wed, 27 Dec 2023 16:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BRGZh3F081791; Wed, 27 Dec 2023 16:35:43 GMT (envelope-from git) Date: Wed, 27 Dec 2023 16:35:43 GMT Message-Id: <202312271635.3BRGZh3F081791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4a0c6403b0ec - main - inpcb: poison several inpcb pointer in in_pcbfree() 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a0c6403b0ec5c6223c2b798fab231a4fac0a6d1 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0c6403b0ec5c6223c2b798fab231a4fac0a6d1 commit 4a0c6403b0ec5c6223c2b798fab231a4fac0a6d1 Author: Gleb Smirnoff AuthorDate: 2023-12-27 16:34:37 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-27 16:34:37 +0000 inpcb: poison several inpcb pointer in in_pcbfree() There are few subsystems that reference inpcb and allow it to outlive in_pcbfree(). There are no known bugs with them to unreference the options pointers for a freed inpcb. Enforce this so that such bugs don't appear in the future. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43134 --- sys/netinet/in_pcb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 63b4fc57230e..fa0d7309058e 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1749,12 +1749,16 @@ in_pcbfree(struct inpcb *inp) #ifdef INET if (inp->inp_options) (void)m_free(inp->inp_options); + DEBUG_POISON_POINTER(inp->inp_options); imo = inp->inp_moptions; + DEBUG_POISON_POINTER(inp->inp_moptions); #endif #ifdef INET6 if (inp->inp_vflag & INP_IPV6PROTO) { ip6_freepcbopts(inp->in6p_outputopts); + DEBUG_POISON_POINTER(inp->in6p_outputopts); im6o = inp->in6p_moptions; + DEBUG_POISON_POINTER(inp->in6p_moptions); } else im6o = NULL; #endif