Commit be85525
RDMA/mlx5: Fix multiple NULL-ptr deref errors in rereg_mr flow
commit b4bd701 upstream.
Failure in rereg MR releases UMEM but leaves the MR to be destroyed
by the user. As a result the following scenario may happen:
"create MR -> rereg MR with failure -> call to rereg MR again" and
hit "NULL-ptr deref or user memory access" errors.
Ensure that rereg MR is only performed on a non-dead MR.
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: <stable@vger.kernel.org> # 4.5
Fixes: 395a8e4 ("IB/mlx5: Refactoring register MR code")
Reported-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 3ae1bf3 commit be85525
1 file changed
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | | - | |
839 | | - | |
840 | | - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
841 | 843 | | |
842 | | - | |
843 | | - | |
| 844 | + | |
844 | 845 | | |
845 | 846 | | |
846 | 847 | | |
847 | | - | |
| 848 | + | |
848 | 849 | | |
849 | 850 | | |
850 | 851 | | |
851 | | - | |
| 852 | + | |
852 | 853 | | |
853 | 854 | | |
854 | 855 | | |
| 856 | + | |
| 857 | + | |
855 | 858 | | |
856 | 859 | | |
857 | 860 | | |
| |||
1340 | 1343 | | |
1341 | 1344 | | |
1342 | 1345 | | |
1343 | | - | |
1344 | | - | |
1345 | 1346 | | |
1346 | 1347 | | |
1347 | 1348 | | |
1348 | 1349 | | |
1349 | 1350 | | |
| 1351 | + | |
1350 | 1352 | | |
1351 | 1353 | | |
1352 | 1354 | | |
1353 | 1355 | | |
1354 | 1356 | | |
1355 | 1357 | | |
1356 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1357 | 1370 | | |
1358 | 1371 | | |
1359 | 1372 | | |
1360 | 1373 | | |
1361 | 1374 | | |
1362 | 1375 | | |
1363 | 1376 | | |
| 1377 | + | |
1364 | 1378 | | |
1365 | 1379 | | |
1366 | 1380 | | |
| |||
0 commit comments