Skip to content
Snippets Groups Projects
Commit f9f690c4 authored by Artemy Kovalyov's avatar Artemy Kovalyov Committed by 谢秀奇
Browse files

IB/mlx5: Skip non-ODP MR when handling a page fault


mainline inclusion
from mainline-4.20-rc7
commit 4d5422a3
category: bugfix
bugzilla: 6625
CVE: NA

-----------------------------

Since any page fault may be interrupted by a MMU invalidation and implicit
It is possible that we call pagefault_single_data_segment() with a MKey
that belongs to a memory region which is not on demand (i.e. pinned
pages). This can happen if, for instance, a WQE that points to multiple
MRs where some of them are ODP MRs and some are not.  In this case we
don't need to handle this MR in the ODP context besides reporting success.

Otherwise the code will call pagefault_mr() which will do to_ib_umem_odp()
on a non-ODP MR and thus access out of bounds.

Conflicts:
	drivers/infiniband/hw/mlx5/odp.c
[jingxiangfeng: '597ecc5a RDMA/umem: Get rid of struct ib_umem.odp_data' is
not nessary to backport. so I have changed to 'umem->odp_data' instead
of 'umem->is_odp'.]

Fixes: 7bdf65d4 ("IB/mlx5: Handle page faults")
Signed-off-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 6ba0a5cb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment