]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.1/io_uring-net-correct-the-type-of-variable.patch
0ecc20ffa9f340a2cebb79d2a7d338a072d53705
[thirdparty/kernel/stable-queue.git] / queue-6.1 / io_uring-net-correct-the-type-of-variable.patch
1 From 9193c7c324f4db41897d17ceaaae71e9e447cd80 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Fri, 1 Mar 2024 19:43:48 +0500
4 Subject: io_uring/net: correct the type of variable
5
6 From: Muhammad Usama Anjum <usama.anjum@collabora.com>
7
8 [ Upstream commit 86bcacc957fc2d0403aa0e652757eec59a5fd7ca ]
9
10 The namelen is of type int. It shouldn't be made size_t which is
11 unsigned. The signed number is needed for error checking before use.
12
13 Fixes: c55978024d12 ("io_uring/net: move receive multishot out of the generic msghdr path")
14 Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
15 Link: https://lore.kernel.org/r/20240301144349.2807544-1-usama.anjum@collabora.com
16 Signed-off-by: Jens Axboe <axboe@kernel.dk>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 ---
19 io_uring/net.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 diff --git a/io_uring/net.c b/io_uring/net.c
23 index 9fc0ffb0b6c12..0d4ee3d738fbf 100644
24 --- a/io_uring/net.c
25 +++ b/io_uring/net.c
26 @@ -516,7 +516,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)
27
28 static int io_recvmsg_mshot_prep(struct io_kiocb *req,
29 struct io_async_msghdr *iomsg,
30 - size_t namelen, size_t controllen)
31 + int namelen, size_t controllen)
32 {
33 if ((req->flags & (REQ_F_APOLL_MULTISHOT|REQ_F_BUFFER_SELECT)) ==
34 (REQ_F_APOLL_MULTISHOT|REQ_F_BUFFER_SELECT)) {
35 --
36 2.43.0
37