]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't use ERR_PTR for user pointers
authorChristoph Hellwig <hch@lst.de>
Wed, 18 May 2022 08:40:01 +0000 (10:40 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 May 2022 12:18:56 +0000 (06:18 -0600)
commit4289a41acff68d003051c1a2a40831d2dffbfa72
tree3b3cf90baa77bd113193170443045f6eb3e54d48
parentfcb437f477a82f15a05beb91d91a88ca7cfa615f
io_uring: don't use ERR_PTR for user pointers

ERR_PTR abuses the high bits of a pointer to transport error information.
This is only safe for kernel pointers and not user pointers.  Fix
io_buffer_select and its helpers to just return NULL for failure and get
rid of this abuse.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220518084005.3255380-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c