linux(4): Fix control message size calculation again

It looks Linux recvmsg allows msg_controllen size less then CMSG_SPACE
buffer, at least for case with one cmsghdr. Glibc misc/tst-scm_rights
test succed on Ubuntu 23.04

Fixes:	 	67116c69 "linux(4): Fix control message size calculation"
MFC after:	1 week
This commit is contained in:
Dmitry Chagin 2023-08-14 15:46:11 +03:00
parent 749a7fb588
commit 7d561928e6

View File

@ -1852,7 +1852,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr,
if (error != 0)
goto bad;
if (outlen + LINUX_CMSG_SPACE(datalen) > maxlen) {
if (outlen + LINUX_CMSG_LEN(datalen) > maxlen) {
if (outlen == 0) {
error = EMSGSIZE;
goto err;