Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED5B25FEED for ; Fri, 17 May 2024 14:28:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956100; cv=none; b=t7Ftf+zHagwd09Dh+vEqXweZatZ6GG8NKKOgOHgEtRyV5yDKonTG1g/8BRn9hxAAVWjTmkXFNVwDs/nWkdxfptQepAJzPN77eCOrH+gXYAV3Z4rsn352xa8iEyEnr1PQfsJMnoKsWm4cB9zOWJZLzPCBe185V8AnyHDWWr8oI10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956100; c=relaxed/simple; bh=8V+OBH+yTdplvI3cq8Av8V3LgOVxpRzlaag9h5mwFpk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=n1NEtpiTI0qHpfR9Ju8FdUFJe+926dVUdDBwUZhxlw6dBR0LmuCo43FtcUX8hOWTAFTO/wOiHydw5yvV1mj1rllA694BkcAvoDtF91us8OuaZcEHlRw4lw9lUqrc06PW3K1KEHcgzCz6JzN8jG6rODXouao3VJSpprFam6+PaNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=p50UmzbU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="p50UmzbU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E3D5C2BD10; Fri, 17 May 2024 14:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715956099; bh=8V+OBH+yTdplvI3cq8Av8V3LgOVxpRzlaag9h5mwFpk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=p50UmzbU22Cy8ZZxdJ4P3bs3AXsy3Zd8biNqcnJ78JFcl648qt3klCye8/zomGnzm iSUipXa7IHhk5tnbXvM7R7mgI5aLSEVCyTKpkuTAV6t4Z52Qg+WFMK2Yr8eAcFbCsE F1o/krbM/oFaFQCe3gx/6ur9RwlezBv4EyF5v9Co= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35841: net: tls, fix WARNIING in __sk_msg_free Date: Fri, 17 May 2024 16:27:14 +0200 Message-ID: <2024051757-CVE-2024-35841-1f2e@gregkh> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2915; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8V+OBH+yTdplvI3cq8Av8V3LgOVxpRzlaag9h5mwFpk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnumYY71Zu7nghklsi5NV32vJdxq/rvHNu15qfeT9XJ+ tuz6FNuRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkz2uGebpSuz2+7Wy59GxD y8Vb/9vmVjBP12FYsCFKdMH2cL87VdEX76n/WhCR/n5WKQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: tls, fix WARNIING in __sk_msg_free A splice with MSG_SPLICE_PAGES will cause tls code to use the tls_sw_sendmsg_splice path in the TLS sendmsg code to move the user provided pages from the msg into the msg_pl. This will loop over the msg until msg_pl is full, checked by sk_msg_full(msg_pl). The user can also set the MORE flag to hint stack to delay sending until receiving more pages and ideally a full buffer. If the user adds more pages to the msg than can fit in the msg_pl scatterlist (MAX_MSG_FRAGS) we should ignore the MORE flag and send the buffer anyways. What actually happens though is we abort the msg to msg_pl scatterlist setup and then because we forget to set 'full record' indicating we can no longer consume data without a send we fallthrough to the 'continue' path which will check if msg_data_left(msg) has more bytes to send and then attempts to fit them in the already full msg_pl. Then next iteration of sender doing send will encounter a full msg_pl and throw the warning in the syzbot report. To fix simply check if we have a full_record in splice code path and if not send the msg regardless of MORE flag. The Linux kernel CVE team has assigned CVE-2024-35841 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit fe1e81d4f73b and fixed in 6.6.14 with commit 02e368eb1444 Issue introduced in 6.5 with commit fe1e81d4f73b and fixed in 6.7.2 with commit 294e7ea85f34 Issue introduced in 6.5 with commit fe1e81d4f73b and fixed in 6.8 with commit dc9dfc8dc629 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-35841 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/tls/tls_sw.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/02e368eb1444a4af649b73cbe2edd51780511d86 https://git.kernel.org/stable/c/294e7ea85f34748f04e5f3f9dba6f6b911d31aa8 https://git.kernel.org/stable/c/dc9dfc8dc629e42f2234e3327b75324ffc752bc9