From nobody Mon Aug 14 12:47:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RPZ0y4gZPz4qRxp; Mon, 14 Aug 2023 12:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RPZ0y49Hnz3C03; Mon, 14 Aug 2023 12:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692017234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V2dXETOlNXPGiECpnpmlnjZX995gsGX5w5SuMzVvcLA=; b=Afj16ckU7eHaYYJYAXlnHtsiFyxB6Xs7q1G0TUBlP2J14rtXkaufrWsM0ThXDYyV1dlOwP 6Gniq3v1e4VG0DfT1aqkAHWyABqXBPEiDv1jwkSio+CmsxRiyJx2I1Dxz/NCMBsfy5EKXx EVkDF0er7sQBKyDlkBAllwZCtPOzMZJxUhoDkB8bJ8eFq4bB0yHkvQ0TGJvc5Q5dDZTzwr 0wtZYnWjCMtQaoLe2AqlWZy3tmYI1E9qXnznjD5nhbyO2vMcuPl28rmBy5IaO/DvCT5e/Y eaW8qFz5uuj81I9Y/0pfjdY3XLy0lKGYnFJb1sJ36/EsJbpePHWF04d0G/NqTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692017234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V2dXETOlNXPGiECpnpmlnjZX995gsGX5w5SuMzVvcLA=; b=oKVPZOC5YISTQbOfEcKrc7H3MhWsOPiAg37V2jGUHSnozYsKipidtFtq6PDKRFj4vxlsmZ D3FNhcPmaXzH+Vrl7tbQYX9NzKQ/n5i2+ubwcR1Ev2Io7pCvh0ZQDsqIj5AJN6qGQDll8u X3iyBJmKMYBVjo57hOr8GcOoK63yH3w04msvqc0CRRY/KLfMGugUizrguHy78muS4cUJi7 CsPN5mX+iSYMBvKBbxGpQ1W91XilDz2ZiUjdlkjnlmWVnVysNkJ5cwAxsW25XCF9P8jK0O fmzWQpfbSLf2N46/bUxjByDNbGKAr9HEOIvaJfGRJEYArBy51koyQ1ZnWf0QqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692017234; a=rsa-sha256; cv=none; b=bFTlr/RCFBiNfrslGKOHU5OqJmV73s/timKfJJIMimAwKihsoNUEo2/XRGAWwViVs2fNyB yw8maSvmM4+DRPXVhvd2wGkhkc6zfaS4nzDVffLegouCUyO+Ajv84lh3Z7F522uV1NGr8/ RXtQk1RL6U3VguAd2pgVJ117/3kTtGPH7TfpyptfihtNeyfeyJKHVPdRDIVo2CjFuvlmQp aft1MRTo751GqALKtgtvTj/0HhTFbnM8AL41dGLrmF7P4azSHKXHAlt4q8MNurkIFKoh6S cG5t7iQwluD7gCQ/rNw/6LZxr1JkAtlaXpdXKl9sGfaT80PqHgZdFx4ernDlfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RPZ0y33XSzTJY; Mon, 14 Aug 2023 12:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37EClE9B044172; Mon, 14 Aug 2023 12:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37EClEj0044169; Mon, 14 Aug 2023 12:47:14 GMT (envelope-from git) Date: Mon, 14 Aug 2023 12:47:14 GMT Message-Id: <202308141247.37EClEj0044169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 7d561928e65a - main - linux(4): Fix control message size calculation again List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d561928e65af6fe90ff9e316b2d50668c53b464 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7d561928e65af6fe90ff9e316b2d50668c53b464 commit 7d561928e65af6fe90ff9e316b2d50668c53b464 Author: Dmitry Chagin AuthorDate: 2023-08-14 12:46:11 +0000 Commit: Dmitry Chagin 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;