Commit 67d1189
io_uring: Fix release of pinned pages when __io_uaddr_map fails
Looking at the error path of __io_uaddr_map, if we fail after pinning
the pages for any reasons, ret will be set to -EINVAL and the error
handler won't properly release the pinned pages.
I didn't manage to trigger it without forcing a failure, but it can
happen in real life when memory is heavily fragmented.
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Fixes: 223ef47 ("io_uring: don't allow IORING_SETUP_NO_MMAP rings on highmem pages")
Link: https://lore.kernel.org/r/20240313213912.1920-1-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 9219e4a commit 67d1189
1 file changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2714 | 2714 | | |
2715 | 2715 | | |
2716 | 2716 | | |
2717 | | - | |
| 2717 | + | |
2718 | 2718 | | |
2719 | 2719 | | |
2720 | 2720 | | |
| |||
2728 | 2728 | | |
2729 | 2729 | | |
2730 | 2730 | | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
2736 | | - | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
2737 | 2737 | | |
2738 | 2738 | | |
2739 | 2739 | | |
| |||
2747 | 2747 | | |
2748 | 2748 | | |
2749 | 2749 | | |
2750 | | - | |
| 2750 | + | |
2751 | 2751 | | |
2752 | 2752 | | |
2753 | 2753 | | |
| |||
2756 | 2756 | | |
2757 | 2757 | | |
2758 | 2758 | | |
2759 | | - | |
| 2759 | + | |
2760 | 2760 | | |
2761 | 2761 | | |
2762 | 2762 | | |
2763 | 2763 | | |
2764 | 2764 | | |
2765 | 2765 | | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
2766 | 2770 | | |
2767 | 2771 | | |
2768 | 2772 | | |
| |||
0 commit comments