From nobody Thu Jun 30 14:50:51 2022 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 3770B877155; Thu, 30 Jun 2022 14:50:52 +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 4LYh8r0vpsz3GN1; Thu, 30 Jun 2022 14:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656600652; 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=iSU32Tim3APn7eBuYiWJW0Hn3rU8NJLlFTmd4fhp+cI=; b=V4xyg1HqnbzGXPcIObQSmqdWRV54WXYbG46l5nVFMALrs6DWj9B1QbpaO0WA/OmHEoUUaA bc1eLCYVZBAcFpXXsH30ZZTSk4x5zz3n2h9qkdcXcYOAtgisc5MGbrTP87jd5TqI0KgQuQ n6GKs9lyAyppf3gIDKT8vk8Jql9dRhNJjCnXsWSMJ95kOAMBXxxrQVQtafrrZd0Cm/gz1J IZoEZEVnIAP/yTocHWDqTy5zO77wIA3sKAyTzMooj9vGlNgaTfg2tapHPg6cHWnLm476CV b9r3Yv3L/sE1+4YgYpTpDJ9KBuRSp5hoz0b5aU8wY1iBAq5UN30xWV9tC3jtMA== 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 ED97343B; Thu, 30 Jun 2022 14:50:51 +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 25UEop5g000856; Thu, 30 Jun 2022 14:50:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25UEopSe000855; Thu, 30 Jun 2022 14:50:51 GMT (envelope-from git) Date: Thu, 30 Jun 2022 14:50:51 GMT Message-Id: <202206301450.25UEopSe000855@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: 66c8e3fccf0c - main - socket: fix listen(2) on an already listening socket 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: 66c8e3fccf0c426865a917f7b1945558b12017e4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656600652; 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=iSU32Tim3APn7eBuYiWJW0Hn3rU8NJLlFTmd4fhp+cI=; b=GcMmc++tXQj1QvKXN/t5/y7I+Zdy2CpNYJO9K+AU4vrwmDMETE2zx2IBwKbxLwsYQvopCi Hd7bkdt2yvNjAgHrVttpLYKwX1YvDgtoEbjw+Q0YNallXk+vV3FX/2W6eNy2tcOdGFD2FY Gt4lmD0tHyfrZZ3fyvlsSBPJdiS1z2LhdFaiicB6nD8uTRL4NbLwaFx+n0/6PDgnqv+bkW kaALs7vm63UB1fAMi+t0ML3B+fwcnnj+j9Q38L9FI2sn3T0XTBCVsBnyUBd0WWQ2lCbTSo gragTF7DjFMbKTkJ5hKPHGZtXQ/N354PM3HR36vdrY1CRH+mHECbucLT0KR3KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656600652; a=rsa-sha256; cv=none; b=oZu4z4ACoewiVNaef3qeg8SZTthkx3pCKUQ2buW1fIwPX/qQb2TTFKOLn9YDieENSkp4Gt C0RHmpbj8iw4Mx5fE2U25BWnZ830F5YTA1ePGGOc8UPkPKX4qZvHfd8BlwWH/K3y/P2sJR ODL1LUzH3/1Josdn40+W1XeQZ17RZEbjBZAwgI6YTrPgPULdRtgGpXxuoWryTK+9Wp3jBi o1cTX7AtmVYN2YLn0Gq5l2GVZg3c/dQM23uuEvyjaPT2CTek2IcQfHeywJwtgzofJlUh6c sL89FfEyciMMsshkWtEP2BgAoift7YAlsLkDYHm72ca2fFQiGwpICps+KarBkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=66c8e3fccf0c426865a917f7b1945558b12017e4 commit 66c8e3fccf0c426865a917f7b1945558b12017e4 Author: Gleb Smirnoff AuthorDate: 2022-06-30 14:50:29 +0000 Commit: Gleb Smirnoff CommitDate: 2022-06-30 14:50:29 +0000 socket: fix listen(2) on an already listening socket Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35669 Fixes: 141fe2dceeaeefaaffc2242c8652345a081e825a --- sys/kern/uipc_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ffaf5acdd05d..5063ae5a56e0 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -948,8 +948,9 @@ solisten_proto_check(struct socket *so) mtx_lock(&so->so_rcv_mtx); /* Interlock with soo_aio_queue(). */ - if ((so->so_snd.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0 || - (so->so_rcv.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0) { + if (!SOLISTENING(so) && + ((so->so_snd.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0 || + (so->so_rcv.sb_flags & (SB_AIO | SB_AIO_RUNNING)) != 0)) { solisten_proto_abort(so); return (EINVAL); }