kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] io_uring: signedness bug in io_async_cancel()
@ 2019-10-31 10:55 Dan Carpenter
  2019-10-31 12:57 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-10-31 10:55 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-fsdevel, linux-block, kernel-janitors

The problem is that this enum is unsigned, and we do use "ret" for the
enum values, but we also use it for negative error codes.  If it's not
signed then it causes a problem in the error handling.

Fixes: 6ec62e598211 ("io_uring: support for generic async request cancel")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index c4cdfe16cba7..9dcbde233657 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2144,8 +2144,8 @@ static int io_async_cancel(struct io_kiocb *req, const struct io_uring_sqe *sqe,
 			   struct io_kiocb **nxt)
 {
 	struct io_ring_ctx *ctx = req->ctx;
-	enum io_wq_cancel ret;
 	void *sqe_addr;
+	int ret;
 
 	if (unlikely(ctx->flags & IORING_SETUP_IOPOLL))
 		return -EINVAL;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: signedness bug in io_async_cancel()
  2019-10-31 10:55 [PATCH] io_uring: signedness bug in io_async_cancel() Dan Carpenter
@ 2019-10-31 12:57 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-10-31 12:57 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-fsdevel, linux-block, kernel-janitors

On 10/31/19 4:55 AM, Dan Carpenter wrote:
> The problem is that this enum is unsigned, and we do use "ret" for the
> enum values, but we also use it for negative error codes.  If it's not
> signed then it causes a problem in the error handling.

I noticed this one the other day, merged in a fix for it then. Not
an issue in the current tree, though linux-next may still have the
older one.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-31 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-31 10:55 [PATCH] io_uring: signedness bug in io_async_cancel() Dan Carpenter
2019-10-31 12:57 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).