Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2021 00:46:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 259380] linux(4): linux_recvfrom(2) fails: linux_recvfrom -1 errno -22 Invalid argument
Message-ID:  <bug-259380-227-BBLNLd3LnA@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-259380-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-259380-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259380

--- Comment #11 from Jason Mader <jasonmader@gmail.com> ---
(In reply to Jason Mader from comment #10)
When linux_recvfrom() calls kern_recvit() the value of msg.msg_namelen is 2=
8,
and after the call it is 0.

kern_recvit() source didn't change, but bsd_to_linux_sockaddr() did. Prior =
to
FreeBSD 12.2, bsd_to_linux_sockaddr() didn't check the value of msg.msg_nam=
elen
(as len). Now it does,

        if (len < 2 || len > UCHAR_MAX)
                return (EINVAL);

I am currently working around this with,

--- linux_socket.c
+++ linux_socket.c
@@ -926,10 +926,10 @@
                goto out;

        if (PTRIN(args->from) !=3D NULL) {
-               error =3D bsd_to_linux_sockaddr(sa, &lsa, msg.msg_namelen);
+               error =3D bsd_to_linux_sockaddr(sa, &lsa, fromlen);
                if (error =3D=3D 0)
                        error =3D copyout(lsa, PTRIN(args->from),
-                           msg.msg_namelen);
+                           fromlen);
                free(lsa, M_SONAME);
        }

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259380-227-BBLNLd3LnA>