git: 7d561928e65a - main - linux(4): Fix control message size calculation again
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 14 Aug 2023 12:47:14 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7d561928e65af6fe90ff9e316b2d50668c53b464 commit 7d561928e65af6fe90ff9e316b2d50668c53b464 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-08-14 12:46:11 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-08-14 12:46:11 +0000 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 --- sys/compat/linux/linux_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index ac411aae1cb3..4c8276b64afd 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1852,7 +1852,7 @@ cont: 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;