From nobody Sat Jan 15 00:51:50 2022 X-Original-To: dev-commits-src-branches@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 60E7D1951C2A; Sat, 15 Jan 2022 00:51:51 +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 4JbKPL6W0Gz4kMs; Sat, 15 Jan 2022 00:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642207911; 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=yFhwWxqsmRba+PjHGJdFutqcfIyUEqZAoAMOcBcBNcQ=; b=boSdnlFuI2N8mJ6h7uZBxRItmBmkBtyNKLNeH2cZKj+nxPg8pFlUUfK9DCzP/W1AdJtexr 797HrOZjwTsMqdaYOvcg/o8w1k/49CjG48ZuIuYuMQ4b8yktZWOUHMHadI+1Y7YmI0Bgc9 hJlccRN4R8FOkm3+oZ4rDjdiAS3wzcscZrpvV5chl9QTRTqmPfKJqmz0sar/e+djwj2+Pt Ih9v1ke8AnBdcKi94e0czWTXnHitCsgzueFgXuZEI7luo6miRZdkUB4Ep/TqRHJV5XJX2B t/W1H1BgGP0onj5GVbhtRdYp+J124D5dQQVJ5HYKSzuTfj+tqP1IKpcnbahA0g== 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 2E3851DD21; Sat, 15 Jan 2022 00:51:50 +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 20F0poV5031404; Sat, 15 Jan 2022 00:51:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20F0poqI031403; Sat, 15 Jan 2022 00:51:50 GMT (envelope-from git) Date: Sat, 15 Jan 2022 00:51:50 GMT Message-Id: <202201150051.20F0poqI031403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 07d32ede469d - stable/13 - libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07d32ede469ddc85b7e92921b4a9f1eeb4dbd66f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642207911; 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=yFhwWxqsmRba+PjHGJdFutqcfIyUEqZAoAMOcBcBNcQ=; b=I4hYqmBjpHL3gIrszSrR0T+G9DT0WE4KWCQxwkwgXWFlc/uMbvUX7SNJHPUDdhMCAikMQc 5WXqxGCc3r1lnPMaxm6G1mXOevr4pCMowKm8Hb4mE154vUjDiBQZwU3FHkQA/RB9uKjJo1 KeHaEAMGX43gN7M+3bSobI7YSThhK67knXutMtkg6739ustLZ1H+TKCclgdDPkWxvkq/sg 1fqDRVeb3ttEJPqs0AjAJC8v1owr0yYGa/TmZ+9rcXMdtClwRcWS2mVKskMHAbIjQaRhv4 Neq0mOeJxt+nbIGEY9PMyHZ16lMz7FCk5u47XE/WB2GoThxRuUEXTIThNpKc9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642207911; a=rsa-sha256; cv=none; b=jPwSlUpzMQkuPerybMJJ3URwlFmNU1RljzEfYVntKbu9iC0FjqgMbjl6zmNllsnhz0zFU3 d+lu1BEZ2sunZ+uiNWlNPwov5cl30H0QVyybfZcR2zjV3ljgvjOuDcBhZncYE94vWpM2g9 m/e0iZwIBN1RYUalekSlK8wjZaWVvhsT04F7wM08zUOeqkBOaQK5Alfg0h6S4fVlJT97h8 fzpdlqUKJBRFHnM9rYFeMSbJq6NzKefWHU9jFS57y/fZi4oMTw5/9UOLw8vMItNFLgL8HM WDZJ4eBP/APwHMjdgDET+uhvavbExFNxog/phxc0YYQ+CvNBL1hVKurRlgb17w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=07d32ede469ddc85b7e92921b4a9f1eeb4dbd66f commit 07d32ede469ddc85b7e92921b4a9f1eeb4dbd66f Author: Konstantin Belousov AuthorDate: 2022-01-09 05:09:22 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-15 00:51:13 +0000 libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper PR: 261051 (cherry picked from commit 6d06bc688eb5a9f9e389b69c388d591a40edc422) --- lib/libc/rpc/rpc_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index 1e5cd86d7ed4..ae23442e9a16 100644 --- a/lib/libc/rpc/rpc_soc.c +++ b/lib/libc/rpc/rpc_soc.c @@ -120,11 +120,11 @@ clnt_com_create(struct sockaddr_in *raddr, rpcprog_t prog, rpcvers_t vers, int * proto = strcmp(tp, "udp") == 0 ? IPPROTO_UDP : IPPROTO_TCP; sport = pmap_getport(raddr, (u_long)prog, (u_long)vers, proto); + mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */ if (sport == 0) { goto err; } raddr->sin_port = htons(sport); - mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */ } /* Transform sockaddr_in to netbuf */