net/rds: reset op_nents when zerocopy page pin fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0cebaccef3acbdfbc2d85880a2efb765d2f4e2e3 · < 640e37f58f991546a87540d067279c2c1fa9fe51| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/rds: reset op_nents when zerocopy page pin fails
When iov_iter_get_pages2() fails in rds_message_zcopy_from_user(), the pinned pages are released with put_page(), and rm->data.op_mmp_znotifier is cleared. But we fail to properly clear rm->data.op_nents.
Later when rds_message_purge() is called from rds_sendmsg() the cleanup loop iterates over the incorrectly non zero number of op_nents and frees them again.
Fix this by properly resetting op_nents when it should be in rds_message_zcopy_from_user().
From the CVE record · Linux
The Linux kernel's RDS zerocopy send path can leave a page count uncleared when page pinning fails. Later cleanup during rds_sendmsg() can release those pages a second time. The input does not specify authentication requirements or whether user interaction is needed.
Engineers running Linux kernels with RDS should check their versions; affected versions are not specified.