From nobody Sat Jan 15 12:58:28 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 79D141960B62; Sat, 15 Jan 2022 12:58:28 +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 4JbdWm2lZcz3N73; Sat, 15 Jan 2022 12:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642251508; 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=fodl3rB86v27qs0Q1HGy3x5P/Onb36ZTxPS6T0ICf+8=; b=nsEUilDzMnSwPw3Wn55QOyaZ6Pvj8oMOELVYQyHVVe+1aoHG6BBz05WI0G6M9Kwh5bEvks G0fl84jT+fnLfFPmveNhrQHxvYbtDxSdH9WgS72GMm8eoOis3lF4pIVVEY7AoYMQE4gYBC eTZP8EDxCzu6gSUD/iBDn9ok7S2qV7QfAi5pLwjqHJJf6mq0JUob/Dj0vxddmOV+QxEpcd 0pA+v1eRzUb1YNSd0rK1CCfsceVkZaLhfRpnD0GswLWglZur8BCrtFEEakVPRvizfFhZLi j5+rLTClD9O8BRuJs468KQLMDT+LLC3ksso/tCuCdf0etEVysz4pADB2z+Dj1Q== 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 271CD27624; Sat, 15 Jan 2022 12:58:28 +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 20FCwSbn094381; Sat, 15 Jan 2022 12:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20FCwSJ0094380; Sat, 15 Jan 2022 12:58:28 GMT (envelope-from git) Date: Sat, 15 Jan 2022 12:58:28 GMT Message-Id: <202201151258.20FCwSJ0094380@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: ac82aa1bf742 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: ac82aa1bf742def55998d27e98496b46c18cfcd5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642251508; 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=fodl3rB86v27qs0Q1HGy3x5P/Onb36ZTxPS6T0ICf+8=; b=GMFW5IciReoDG86iAso25Y0zjoHw0TEZtuOdG9ZG5AWp+25F1SJmxQigeaYmYNfdqtDvc/ KDe4q+Xc4hTWqm5tPUKhzUU+dO8xna9rNQeQ3RQ6d+WemedkQ2H5Tsd/QFyVlKOxKQklZZ OyIzkLSByrxk6EFwwUIeJeowJsm6GEYIoAVvtDvNTOyK7gFW6qN3RJILh8ayiC9xlMErdu H36BYAOLSczTOCFk+pAVsPnSrToFKT4iOHXybDzaUGzFe9iEnP/G0s/NWMk6tNCgNU75vu QytdVz8Rti2Drwjj4uk5u6wkkQrzta5P+NcbDWnpP98lH5ECJh7fNDfD0fRvwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642251508; a=rsa-sha256; cv=none; b=u8ZgIUaDWXNQexphwcvs+rN6SALeJgXwkY6weSCt05N5BNC26+VigSHw4Gji9TiHE/nRXo zJNdo9V9aCMayOZeY4OK2unWbHdt4BQVrc83RLX3nJ/eX1hB0VLxbHYn9O4aN8KxnDPS3o duqxviKjp99paSQwq973S9JQxSp0O9LiXuJYTQCKjOn4B1sykkt0Bx5JuytPkGX+G0B1+F ygxzvoasD5j1YKC8JnbKGJqBOeXdJtgeZlRuoRaRbwqe1JYrvyi7w9KjA9IdF/EwqUJUW0 RX78hJ+xycTVp9FLU3trJBQSoW1jYQUpuVWDnE4i1lONdk5FmC8vfzlre3fmgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac82aa1bf742def55998d27e98496b46c18cfcd5 commit ac82aa1bf742def55998d27e98496b46c18cfcd5 Author: Konstantin Belousov AuthorDate: 2022-01-09 05:09:22 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-15 12:57:40 +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 */