lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210426093735.7932-1-colin.king@canonical.com>
Date:   Mon, 26 Apr 2021 10:37:35 +0100
From:   Colin King <colin.king@...onical.com>
To:     Jens Axboe <axboe@...nel.dk>,
        Pavel Begunkov <asml.silence@...il.com>,
        io-uring@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] io_uring: fix incorrect check for kvmalloc failure

From: Colin Ian King <colin.king@...onical.com>

Currently imu is being allocated but the kvmalloc failure is checking
imu->bvec instead of imu.  Fix this by checking imu for null.

Addresses-Coverity: ("Array compared against 0")
Fixes: 41edf1a5ec96 ("io_uring: keep table of pointers to ubufs")
Signed-off-by: Colin Ian King <colin.king@...onical.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 57a64c7e0e69..f4ec092c23f4 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8269,7 +8269,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
 		goto done;
 
 	imu = kvmalloc(struct_size(imu, bvec, nr_pages), GFP_KERNEL);
-	if (!imu->bvec)
+	if (!imu)
 		goto done;
 
 	ret = 0;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ