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 CFF62199242 for ; Tue, 16 Jul 2024 11:47:13 +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=1721130433; cv=none; b=lIsWzMwWOV1O8ppRG1UWWl5UTA0Gfadku339rs33yKCGYnolZnwErlOLcsN3jqpSJ2x7WKiR5RZqlboClFJmJGsZ0J7UKHV7TvHWJ/oqRt0oHKLrhabYt4nU4J59pisRV4c301SgQyuIxm54dSQXe8Wv7nISFBo/f8p4hZ6sMzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721130433; c=relaxed/simple; bh=EQMtXVODpHNJcYXg962zvV3lDtSGm2xv10LV0jBo+Zs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NnlfZ60kTGfQ7W0Bp+x94wfT+zz9A2oDAPmF806GZ9XXQDVuVRkdUKUxgKvX8Bxji67bbsxRttEUqR5+7Tx1LaJ2wBlPohMwICFbFURxLi47NnDKyZrq+trVVliBzaR/1HBmWgg/d1mQQGjslmQxjxb44R/6oUBuhYwiL5zLI4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Uvi6nCOT; 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="Uvi6nCOT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF49C116B1; Tue, 16 Jul 2024 11:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721130433; bh=EQMtXVODpHNJcYXg962zvV3lDtSGm2xv10LV0jBo+Zs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Uvi6nCOTGKwlWHypPDjk9RldMnSUaVu3R9ravVE5boP9g+CyGA1NkYEqUFMdrNHIp OQ/VHISV4FK2LcgXjnywlDkFhPYeONL2BABJQd9JKAjQsbl3wP0OFLA8O6QNNppMqV qSbygrlpwzQqYKh/TzYT8fVuqkePZ9vEKvOC/bRQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48819: tcp: take care of mixed splice()/sendmsg(MSG_ZEROCOPY) case Date: Tue, 16 Jul 2024 13:46:11 +0200 Message-ID: <2024071649-CVE-2022-48819-16f6@gregkh> X-Mailer: git-send-email 2.45.2 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=2275; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=EQMtXVODpHNJcYXg962zvV3lDtSGm2xv10LV0jBo+Zs=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnTYnOrLKyFI2TXakYoxp1YZiZ+OWXDd1OzhzNXnV3ed HBt18GUjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIAQuGBa0iQqLFl1wK8/vd Z1WYvvz9QWX9Zob54Y/3cvz+IL7OvCtu/sarDy9LSm4qAAA= 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: tcp: take care of mixed splice()/sendmsg(MSG_ZEROCOPY) case syzbot found that mixing sendpage() and sendmsg(MSG_ZEROCOPY) calls over the same TCP socket would again trigger the infamous warning in inet_sock_destruct() WARN_ON(sk_forward_alloc_get(sk)); While Talal took into account a mix of regular copied data and MSG_ZEROCOPY one in the same skb, the sendpage() path has been forgotten. We want the charging to happen for sendpage(), because pages could be coming from a pipe. What is missing is the downgrading of pure zerocopy status to make sure sk_forward_alloc will stay synced. Add tcp_downgrade_zcopy_pure() helper so that we can use it from the two callers. The Linux kernel CVE team has assigned CVE-2022-48819 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 9b65b17db723 and fixed in 5.16.10 with commit 47f3860c4931 Issue introduced in 5.16 with commit 9b65b17db723 and fixed in 5.17 with commit f8d9d938514f 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-2022-48819 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/ipv4/tcp.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/47f3860c4931175f112f28dcac66eacca9b1040f https://git.kernel.org/stable/c/f8d9d938514f46c4892aff6bfe32f425e84d81cc