HomeFreeBSD

LinuxKPI: fix sg_pcopy_from_buffer()

Description

LinuxKPI: fix sg_pcopy_from_buffer()

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
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30676

(cherry picked from commit edfcdffefc1671b7688c8806ae1f59484954dcc7)

Details

Provenance
bzAuthored on Jun 7 2021, 3:00 PM
Reviewer
hselasky
Differential Revision
D30676: LinuxKPI: fix sg_pcopy_from_buffer()
Parents
rG3a606aadf2e7: LinuxKPI: pci: cleanup some code and add support for "pcim" (managed)
Branches
Unknown
Tags
Unknown