From nobody Sat May 28 03:49:00 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 186331B42C27; Sat, 28 May 2022 03:49:01 +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 4L972N71Y3z4vck; Sat, 28 May 2022 03:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653709741; 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=7aiDeD55lbvEtIsSJcAVOykxfaLg2CQGNStMQeI8MeE=; b=XLOtN3TEcsXfyC+lTaDcbRW8Ykqa0qVh7e+MSX/cHk+icC3b8XaxbzfiCaAWcdTkVon65u Y83jBf/jwW5EwJT1ngYu6U1EahpgDBEdudn+Jxql6JsUo2RfWV1q2LfR0IgGWOkaabsaOT wHrzwk6QcsOhoC5Ku5wuIt8TIpunkCDwWDdU7XH9adz3w0gNPr8+FT/RDEbF/8KrXt0Kcy rCM7fiSSGT182OgERd6oHva7XNzY0K64GR/JeirPmpZA/nwTNAl8XkfwSFpBBblYZOTUt2 fDvwxq2J/RYCH3jx3snKBjYpMjUhQufPjMIry0fPlGTDMh8FW2Bz0zRJDR3yaA== 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 CFB442F54E; Sat, 28 May 2022 03:49:00 +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 24S3n0St014425; Sat, 28 May 2022 03:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24S3n064014424; Sat, 28 May 2022 03:49:00 GMT (envelope-from git) Date: Sat, 28 May 2022 03:49:00 GMT Message-Id: <202205280349.24S3n064014424@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: d64f2f42c111 - main - unix: unp_externalize() can M_WAITOK 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: d64f2f42c111009dade9ab7ae4d75a0256630e14 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653709741; 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=7aiDeD55lbvEtIsSJcAVOykxfaLg2CQGNStMQeI8MeE=; b=Nz2Qb37kDAfpD3giTOF/VhWDaSPCSDMA3GUJ0Ln+S6RRTdz4jp7pU4PsWZX10joAy7LrOv 3STPFdE+5zM7f07SiVeexnFjbTf9lwryuZdnuHFsBAQUotiuj3JPN3RUK4vE3j869u8dk5 w/mNU2HGCduZPPeQwr52EUnQt3HlUucqxFih/c1b7120lGh3g9VPiaWeja5Z+lOSL/yciB NZC9kpxs24viFr9anj7fhFxFsrhGwzoaznjrTS5G6n7Z+3ql2QKOCnwzVkCxnqvCrNwGIc SL3uDkDZc5WkkBiVEATzZ07IwIK79nzd9oyACjS2lygEaEsmcBwJ5uffrRbT7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653709741; a=rsa-sha256; cv=none; b=fbtukpB0A68xjVEwvsDIuQryjG5urZ0vK51sxpKpi/S4RQOVTKjAn6Q0xhy04lxXeucusM D2ocHsUl6VvKFZxzZJmiaZTDGzi4Eh4ed5ZovwNVz09GwCy7NUO7psblEWsjuaRs2hAhVX xd/g3NACNPGwnyVoHbQA2r3NqCw/CuSmCYwRG7G4QUbqJ1yNg73LqVbmyVOk4lsTULvBX9 AYV9TeA2n5FLQmmHVGqioZJNAqTwrABtMacM1gs2tNyNtG5xHZtEo5z3YchV3nli0xZ3HM 456p6ggzEY1H076pS+sCNoQLIeBvI1zLOq1oKsHOd3GLsEeXwthJzMjEYArSaQ== 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=d64f2f42c111009dade9ab7ae4d75a0256630e14 commit d64f2f42c111009dade9ab7ae4d75a0256630e14 Author: Gleb Smirnoff AuthorDate: 2022-05-28 03:48:38 +0000 Commit: Gleb Smirnoff CommitDate: 2022-05-28 03:48:38 +0000 unix: unp_externalize() can M_WAITOK Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35318 --- sys/kern/uipc_usrreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 4903120fffeb..0796c383134c 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2041,13 +2041,7 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) */ newlen = newfds * sizeof(int); *controlp = sbcreatecontrol(NULL, newlen, - SCM_RIGHTS, SOL_SOCKET, M_NOWAIT); - if (*controlp == NULL) { - FILEDESC_XUNLOCK(fdesc); - error = E2BIG; - unp_freerights(fdep, newfds); - goto next; - } + SCM_RIGHTS, SOL_SOCKET, M_WAITOK); fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); @@ -2079,11 +2073,7 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) if (error || controlp == NULL) goto next; *controlp = sbcreatecontrol(NULL, datalen, - cm->cmsg_type, cm->cmsg_level, M_NOWAIT); - if (*controlp == NULL) { - error = ENOBUFS; - goto next; - } + cm->cmsg_type, cm->cmsg_level, M_WAITOK); bcopy(data, CMSG_DATA(mtod(*controlp, struct cmsghdr *)), datalen);