From nobody Wed May 25 20:30:07 2022 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 F12001B4C3A5; Wed, 25 May 2022 20:30:07 +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 4L7jNv6Kqlz3j15; Wed, 25 May 2022 20:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653510607; 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=X845S1hagpO8r/MT/Ah/WKuRg8K82KVcjADbD4PxE1o=; b=OhZc3DuqZoC6ike2IxdHxX3AVRcbkF1JFHkD465u6vR55+dwlaDPqwA8SaK/48lTxctmGW 4XIHILOGOMFBqvSC5m5dHDvBIpAWvI7l6D+8e8JANRahmhIOOkzjN4n+Z+v2I3hP+3TQ+V caSQs6iaUQOEPmg2ltRt7c9Us7LyG4BvQQiYPVKV2Nk9V/A6ANlK0K57QfQPdvszlUeU+O zT5J//WvL2gC8nHTE1F87x0VGvECdHBOxleAsZG70VbKRd0/nf7jknE5X38WFhISy8Urnr Z1OAaKLdb7pjRriKgRdeZJXA1gACw+o7nWf7KDFZ6KheCWxRt85ZjUy5YAPFcQ== 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 B57B61FFB7; Wed, 25 May 2022 20:30:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24PKU7qY040348; Wed, 25 May 2022 20:30:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24PKU7Ec040346; Wed, 25 May 2022 20:30:07 GMT (envelope-from git) Date: Wed, 25 May 2022 20:30:07 GMT Message-Id: <202205252030.24PKU7Ec040346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d60ea9a10a79 - main - sockets: return EMSGSIZE if control part of message is too large 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d60ea9a10a79b45491cd965b6006aadf29badcf9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653510607; 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=X845S1hagpO8r/MT/Ah/WKuRg8K82KVcjADbD4PxE1o=; b=d82Zu2XUCbHjTb3EG+LG53pLYDQXX5bhYyYYz+9Nal2Kb/WRPOzUFRaW5rOJDjPx3BeCuw BGxRfxtlERs1LHOP3JcL5edpdad50a8jBTxo+FapzojhQ0vaEGqSwqRf27IWh9P7D6YVna ft1BdaXCPN2ugthJ6ftvnqfGFUT8pyEOITUuYWX6ECAqth+65sOt/FyCNev0VypwDEn5KA vw57FEZ45fiCT1HgOGh3s7OVIfen1/2I7Xo3ZKLZ1jBx7RAgG+G43qFcTaK8InK6NgAKqg vzjDRiYSBkin6ecW4zQ2Lg8kkoUpOXT8Y9zbaqob/CV7JzBfzlyrG3BGMdUqfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653510607; a=rsa-sha256; cv=none; b=QKdl1BdNh+95vOjrwyMQL4t9F4P6twASYfIrrIwWRqJjbgdy6oQz9OlWIbXrLDeWrrXCGC 2+eUBB84n6pn9A17JJ2gQzLXPBkwBuaWfHGaUnhWv0zquRxGcc/Y2jk/ugL5RJ8wcBlXtw 9H/4mt7SWl5eE+u8R+qWv/hsc3bxyUC7sw7wuYbZqOt32FtJ7xbooeA4q46Y+9CDnEZMzp U+k9PFtfOMjMXUTS4qFTxTHk41HDBwm8oXoojNCOGFMEYNOB8p0G4MjK5kORuhrk/vRU7I 3wGtTCPXjwT6hvBuwKSjW7WxVvWSs35KrEc0tKsE1kwxDGx6ZFrrOn+n6ad5SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d60ea9a10a79b45491cd965b6006aadf29badcf9 commit d60ea9a10a79b45491cd965b6006aadf29badcf9 Author: Gleb Smirnoff AuthorDate: 2022-05-25 20:29:04 +0000 Commit: Gleb Smirnoff CommitDate: 2022-05-25 20:29:04 +0000 sockets: return EMSGSIZE if control part of message is too large Specification doesn't list an explicit error code for the control size specified by msg_control being too large. But it does list EMSGSIZE as error code for "message is too large to be sent all at once (as the socket requires)". It also lists EINVAL as code for the "The sum of the iov_len values overflows an ssize_t." Given how generic and uninformative EINVAL is, the EMSGSIZE is more appropriate. https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35316 --- sys/kern/uipc_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 72336d31071c..fef5dce796d2 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1521,7 +1521,7 @@ sockargs(struct mbuf **mp, char *buf, socklen_t buflen, int type) else #endif if (buflen > MCLBYTES) - return (EINVAL); + return (EMSGSIZE); } m = m_get2(buflen, M_WAITOK, type, 0); m->m_len = buflen;