From nobody Tue Nov 17 17:08:24 2026 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 4jTWQc3B7mz71SDC for ; Tue, 17 Nov 2026 17:08:24 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWQc1rk4z4N8T for ; Tue, 17 Nov 2026 17:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQkIvgSZq65LByBjf0VAuuYK25IjDNWYfGeLUa6MoTw=; b=oKPdzD9zJuilXltki3vePluYW5PJfv5KSePfIVP2dchWeIjwGodjOXE4nn1tMsm/pdFVxQ EKjkl8IvIuGR9fsfjg07wTpbzLf/pj4XUmoi4L6XLX4WC+/bD2BNzKLvW/fDz+HV1Z8eqh EK6xNGjcwYiZIlKzQABeiwuPfATCusBNksyyjqKjAOyo5R76vHUinrBCF661GK346BDN7C oU7P4eHAIkDpqz/+tN7lovILYQYrZuPs23mwbK/KMLgqb0THqiQwCUZ+yarj2zGjTZxrhA rXVIXRFK+s/paZlj0yPApTxdhiOAP+kK5CSk/jbCIcaKfe5ZqYCjOAqUBfc/Wg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935304; b=gd/kT4oaailq8BW/05jB0kBrM59bRr9e82mm5cOzb0l4BJFk2HSSKezB7/zHbUfm5CIj8F U60MU0ginHk4xVp8k2+EsHIFQfCM+9edQ8I18VrmrHyTDhBi4etblXdO9yoHMTsyHhQjgl SEwKq3vfNWrQHPIbMmCrL9cpIPs4RlyY98qYKED4gOjjn0Cel0T9p6dC17VpPFhM3X26Q4 7vcL/BHu18SKujt3H2JqdeR72ADHAPdfqIxKa/GY4ypd9cGApAIG7yyUHjjrTbUimAERNC 39RqqIh/Cw1YTkEbhoxiTA7iaJqPAj7PKmLZptcOm6Xa8aUy5+fOYH+ekw3DAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQkIvgSZq65LByBjf0VAuuYK25IjDNWYfGeLUa6MoTw=; b=WBpq60mkzdLMSLZ0+qoWAHzsKmgS14cmVp820poGHGBPi6exzR2yb0A2xuNyaPxZauMjMi IzYj8mjPLW4p5E8OPhpJjOs87Y/sNzxu00Y6bId/3912UuwsOcKtkqqD5avU4aavLdU8/v cbhcHpvOoNvZmuFHukd6QLupGShIIo36jt0zipciieCKL7Rm0kn+4lLuOl96hdVeD5Ldml IVaYMhrRy84GOUNlq+Vv7Qf8QOAwBVVHctnmZ3HCvsKKhFG9ZM8Y8BbM6AezYPomHKG+L2 lkKPrZSCxOLnmf1JLDhRPkc3G62GZaSM7F7qVVmYEYUP+BqIJ6TZ44cyZLfPgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWQc1Rxdzrxy for ; Tue, 17 Nov 2026 17:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c17 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:08:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Kyle Evans From: Mark Johnston Subject: git: 7e95a8f5c410 - releng/15.1 - socket: remove tautological condition in so_unsplice() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.1 X-Git-Reftype: branch X-Git-Commit: 7e95a8f5c410259f2361c44db3d6b02478c8cd10 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:08:24 +0000 Message-Id: <6afc8a08.c17.72626d89@gitrepo.freebsd.org> The branch releng/15.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7e95a8f5c410259f2361c44db3d6b02478c8cd10 commit 7e95a8f5c410259f2361c44db3d6b02478c8cd10 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Mark Johnston CommitDate: 2026-11-16 21:25:03 +0000 socket: remove tautological condition in so_unsplice() so2rele was introduced in 1000cc4a0d3 and it was necessary there, but the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT is to be believed: we've asserted that `so2->so_splice_back == sp` and `sp` has been dereferenced above, so there's no condition left where we shouldn't release the socket reference at the end. Indeed, the change in so_splice() to NULL out sp->dst removes that possible state of a partially constructed splice: if sp->dst is set, it has been ref'd. Approved by: so Security: FreeBSD-SA-26:87.socket Reviewed by: gallatin, markj (cherry picked from commit 8a3d28375450946e4b0de239c9239df54c22d298) (cherry picked from commit 2b25a0ebb48dc2340e1e15d1a05b89d7df036b38) --- sys/kern/uipc_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1d535623161b..d31d91d9ef91 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1773,7 +1773,7 @@ so_unsplice(struct socket *so, bool timeout) { struct socket *so2; struct so_splice *sp; - bool drain, so2rele; + bool drain; /* * First unset SB_SPLICED and hide the splice structure so that @@ -1818,7 +1818,6 @@ so_unsplice(struct socket *so, bool timeout) KASSERT(so2->so_splice_back == sp, ("%s: so_splice_back != sp", __func__)); so2->so_snd.sb_flags &= ~SB_SPLICED; - so2rele = so2->so_splice_back != NULL; so2->so_splice_back = NULL; SOCK_SENDBUF_UNLOCK(so2); SOCK_UNLOCK(so2); @@ -1864,8 +1863,7 @@ so_unsplice(struct socket *so, bool timeout) sorele(so); if (so2 != NULL) { sowwakeup(so2); - if (so2rele) - sorele(so2); + sorele(so2); } CURVNET_RESTORE(); so_splice_free(sp);