diff options
author | Yishai Hadas <yishaih@nvidia.com> | 2023-01-05 13:23:39 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-01-05 16:01:05 -0400 |
commit | e95d50d74b93a767a026f588e8de0b9718a0105e (patch) | |
tree | e82ab6b8a095c764d6b37edb14059a1bec857cc4 /lib/iov_iter.c | |
parent | 8de8482fe5732fbef4f5af82bc0c0362c804cd1f (diff) | |
download | linux-e95d50d74b93a767a026f588e8de0b9718a0105e.tar.bz2 |
lib/scatterlist: Fix to merge contiguous pages into the last SG properly
When sg_alloc_append_table_from_pages() calls to pages_are_mergeable() in
its 'sgt_append->prv' flow to check whether it can merge contiguous pages
into the last SG, it passes the page arguments in the wrong order.
The first parameter should be the next candidate page to be merged to
the last page and not the opposite.
The current code leads to a corrupted SG which resulted in OOPs and
unexpected errors when non-contiguous pages are merged wrongly.
Fix to pass the page parameters in the right order.
Fixes: 1567b49d1a40 ("lib/scatterlist: add check when merging zone device pages")
Link: https://lore.kernel.org/r/20230105112339.107969-1-yishaih@nvidia.com
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'lib/iov_iter.c')
0 files changed, 0 insertions, 0 deletions