Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2023 11:41:14 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1cb6dc1627c4 - stable/13 - linux(4): Fix control message size calculation again
Message-ID:  <202308211141.37LBfEg3045443@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=1cb6dc1627c46a0d4b461a4c76f9ac681a5dff27

commit 1cb6dc1627c46a0d4b461a4c76f9ac681a5dff27
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-08-14 12:46:11 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-08-21 10:39:04 +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
    
    (cherry picked from commit 7d561928e65af6fe90ff9e316b2d50668c53b464)
---
 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 393faa5429ce..b30ec4e270f4 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1847,7 +1847,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308211141.37LBfEg3045443>