Commit e1c7583
io_uring: fix potential page leak in io_sqe_buffer_register()
If allocation of the 'imu' fails, then the existing pages aren't
unpinned in the error path. This is mostly a theoretical issue,
requiring fault injection to hit.
Move unpin_user_pages() to unified error handling to fix the page leak
issue.
Fixes: d8c2237 ("io_uring: add io_pin_pages() helper")
Signed-off-by: Penglei Jiang <superman.xpt@gmail.com>
Link: https://lore.kernel.org/r/20250617165644.79165-1-superman.xpt@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent f2320f1 commit e1c7583
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
813 | | - | |
| 812 | + | |
814 | 813 | | |
815 | | - | |
816 | 814 | | |
817 | 815 | | |
818 | 816 | | |
| |||
842 | 840 | | |
843 | 841 | | |
844 | 842 | | |
| 843 | + | |
| 844 | + | |
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
| |||
0 commit comments