From nobody Mon Apr 11 20:32:53 2022 X-Original-To: dev-commits-src-main@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 8AE4111DFB8E; Mon, 11 Apr 2022 20:32:54 +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 4KcgXQ0NqXz3Qjx; Mon, 11 Apr 2022 20:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649709174; 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=N2b3847kA7n2KPYxZge3HwqP+GvQk7TM8m+mX36cvTs=; b=FeowBy9FIuXW7JRk5X+ehvrtvRjL45CBnhqAvgc2b/EqENcp1K+eFDMNke/l6OlurBH8r5 EgkQiPAhR0Jgun43dngTCgqvWXwL8+CGymFNFbwP9tMCMBFr6wn8wSnIhWbUAf35TQhSlE 2gtx4tOgNgmIgjb9+xY1gClJe08rZnRBkxSorAFAoaLdZq2qKbVX1+bZHoydxZePyL5aWP TCNNrSUErG23glatLYTSCNEyfPrVZJgoKxogdB9nvM6QH+87cYsBCfY1QE+T+t0bbVM4B6 IS886Q80rC4d/OlXVGCK52cxUxloAebRPlNf2UFtmO6syD+hjmIRAsbic4rWSw== 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 C049717DC; Mon, 11 Apr 2022 20:32:53 +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 23BKWrL2082873; Mon, 11 Apr 2022 20:32:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23BKWrDB082872; Mon, 11 Apr 2022 20:32:53 GMT (envelope-from git) Date: Mon, 11 Apr 2022 20:32:53 GMT Message-Id: <202204112032.23BKWrDB082872@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: bb0f644cd680 - main - linux(4): Limit user-supplied sockaddr length in recvfrom(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: bb0f644cd680d20b3112f6c14dc853171f497a88 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649709174; 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=N2b3847kA7n2KPYxZge3HwqP+GvQk7TM8m+mX36cvTs=; b=xiClL7KeoaL4l0oS9dmvfL78ysIxjGpw/HAK9mrixunvt0pNj56522s4jOZD6QWYnISpSG CLyXVZK4FDnmQh0muOKGbvbmwe8DqfuJImQbXsBIMa5EZisiOip+alI4rr9jY2twK6jKdq VdktTTfQGgcXj2iWI2+2V6/Pmp0nurbY+uBR6AXWcyLlKbNVG8GH7331v/0qISxQ9zcxyz XxcHnofpvPTT1Nc51Sb73WuskM995KMy33BVVQBahIKVktpUwfoWNpA7VXBswELy8ey2LD E0rSVNHl2Ip1gkJ030xCW+9Zhb80krpWvBgmYNcboHOR83pzeArapJro0XFgkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649709174; a=rsa-sha256; cv=none; b=nFqnmZgYePJTNVNCuPjnghAZwF+LLPwv7069TR+270n4BDQHP7/E5o4jivPNRiQCxrRMC/ +fuEo4cocfztP2nIS7GIvbXcBJQW+0rOIx8hx2vaj32R20523LbTXMC1kg/ktZYSg3dGch PbuukrpQH4T0mhBEUqB0YhaKtfm2l+gkLVZyI//b3WtvdYcJIHkheOpFXDg3z14hw1YZ9W 14fxCUgjq7JyvUwq/BP6YTFXIK6xcX8XbZEJHZamXAUXlPx8K+IPaGWY99V2hAghpDAmZW STje8j2cWCp/vglDPNTZVjeA9cUV0OIzMcS69eJrv7kicfzdeHxOl3TDuSVjCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bb0f644cd680d20b3112f6c14dc853171f497a88 commit bb0f644cd680d20b3112f6c14dc853171f497a88 Author: Dmitry Chagin AuthorDate: 2022-04-11 20:32:28 +0000 Commit: Dmitry Chagin CommitDate: 2022-04-11 20:32:28 +0000 linux(4): Limit user-supplied sockaddr length in recvfrom(). Differential Revision: https://reviews.freebsd.org/D34726 --- sys/compat/linux/linux_socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 16e8c7dadb98..622e25651dbb 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1272,6 +1272,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args) return (error); if (fromlen < 0) return (EINVAL); + fromlen = min(fromlen, SOCK_MAXADDRLEN); sa = malloc(fromlen, M_SONAME, M_WAITOK); } else { fromlen = 0;