aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2022-05-28 03:48:38 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2022-05-28 03:48:38 +0000
commitd64f2f42c111009dade9ab7ae4d75a0256630e14 (patch)
tree56928b894f78bab3a9022f8e6d23547fbe9367e7
parenta7bb120f8b8735bc4c417b3c8fc2308c3d2964aa (diff)
downloadsrc-d64f2f42c111009dade9ab7ae4d75a0256630e14.tar.gz
src-d64f2f42c111009dade9ab7ae4d75a0256630e14.zip
unix: unp_externalize() can M_WAITOK
Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35318
-rw-r--r--sys/kern/uipc_usrreq.c14
1 files 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);