Page MenuHomeFreeBSD

LinuxKPI: fix sg_pcopy_from_buffer()
ClosedPublic

Authored by bz on Jun 7 2021, 3:16 PM.
Tags
None
Referenced Files
F132523424: D30676.id90526.diff
Fri, Oct 17, 3:58 PM
Unknown Object (File)
Thu, Oct 16, 11:58 AM
Unknown Object (File)
Thu, Oct 16, 11:58 AM
Unknown Object (File)
Thu, Oct 16, 11:58 AM
Unknown Object (File)
Thu, Oct 16, 12:12 AM
Unknown Object (File)
Mon, Oct 13, 6:19 AM
Unknown Object (File)
Sep 3 2025, 2:23 AM
Unknown Object (File)
Aug 21 2025, 12:59 AM
Subscribers

Details

Summary

In sg_pcopy_from_buffer() is an error in that skip can underflow
and lead to bogus page arithmetics which may lead to memory corruption
or more likely panics. Once we found a s/g page to copy into there
is nothing to skip anymore so simply set skip to 0.

Sponsored by: The FreeBSD Foundation
MFC after: 5 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable