[PATCH 5.3 044/105] io_uring: transform send/recvmsg() -ERESTARTSYS to -EINTR

From: Greg Kroah-Hartman
Date: Wed Dec 11 2019 - 10:57:49 EST


From: Jens Axboe <axboe@xxxxxxxxx>

commit 441cdbd5449b4923cd413d3ba748124f91388be9 upstream.

We should never return -ERESTARTSYS to userspace, transform it into
-EINTR.

Cc: stable@xxxxxxxxxxxxxxx # v5.3+
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
fs/io_uring.c | 2 ++
1 file changed, 2 insertions(+)

--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1535,6 +1535,8 @@ static int io_send_recvmsg(struct io_kio
ret = fn(sock, msg, flags);
if (force_nonblock && ret == -EAGAIN)
return ret;
+ if (ret == -ERESTARTSYS)
+ ret = -EINTR;
}

io_cqring_add_event(req->ctx, sqe->user_data, ret);