Bug 1227934 (CVE-2022-48819) - VUL-0: CVE-2022-48819: kernel: tcp: take care of mixed splice()/sendmsg(MSG_ZEROCOPY) case
Summary: VUL-0: CVE-2022-48819: kernel: tcp: take care of mixed splice()/sendmsg(MSG_Z...
Status: REOPENED
Alias: CVE-2022-48819
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/414201/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-16 13:27 UTC by SMASH SMASH
Modified: 2024-07-18 15:46 UTC (History)
2 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SMASH SMASH 2024-07-16 13:27:10 UTC
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

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2022-48819
https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2022/CVE-2022-48819.mbox
https://git.kernel.org/stable/c/47f3860c4931175f112f28dcac66eacca9b1040f
https://git.kernel.org/stable/c/f8d9d938514f46c4892aff6bfe32f425e84d81cc