From patchwork Wed Aug 10 00:31:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BF4DC19F2D for ; Wed, 10 Aug 2022 00:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbiHJAce (ORCPT ); Tue, 9 Aug 2022 20:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiHJAcb (ORCPT ); Tue, 9 Aug 2022 20:32:31 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854A372ED1 for ; Tue, 9 Aug 2022 17:32:30 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 6845080872; Wed, 10 Aug 2022 00:32:27 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091550; bh=jCCTmOx9NmGfxdpLE7rPWkrAzBsa5pgaAzqzz83v3qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPiZd6Pba55KtFvWLD4mawnJsHniTZ5AvCqgUwbx6z6WKk/OrkPZJQdAJ7Drbsjiv h4su6R4m+KBm0bbWbp9CpS8rt1CFlUVXcvxSCAQSIOfIYnFtwAS7ulF+lfniv1Ta6k HVLpSrF8qng1UwSsogd6ZcPdQxQ3YdQKLOtJ5XlYJEfv+FvFEcalJgqbdWTYnhpIZn q3OJS09eFSdaawAldxOMQs4FNd6l0KCdgUNBk30m7Y28JcSf6EG4K8nM5EH9a2zZ98 L0P2YwUrMhH0WMDjRPz3iNIIhdYe2Hz5ELecCJJmdWPACU4BXs202FjMtyXDoEGC4z CfNxSf/kLAf6A== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 01/10] test/cq-overflow: Don't call `io_uring_queue_exit()` if the ring is not initialized Date: Wed, 10 Aug 2022 07:31:50 +0700 Message-Id: <20220810002735.2260172-2-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Don't call `io_uring_queue_exit()` if the ring is not initialized. Fix this: + valgrind -q ./cq-overflow.t file open: Invalid argument ==3054159== Use of uninitialised value of size 8 ==3054159== at 0x10A863: io_uring_queue_exit (setup.c:183) ==3054159== by 0x1095DE: test_io.constprop.0 (cq-overflow.c:148) ==3054159== by 0x109266: main (cq-overflow.c:269) ==3054159== ==3054159== Invalid read of size 4 ==3054159== at 0x10A863: io_uring_queue_exit (setup.c:183) ==3054159== by 0x1095DE: test_io.constprop.0 (cq-overflow.c:148) ==3054159== by 0x109266: main (cq-overflow.c:269) ==3054159== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==3054159== ==3054159== ==3054159== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==3054159== Access not within mapped region at address 0x0 Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/cq-overflow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cq-overflow.c b/test/cq-overflow.c index 0018081..312b414 100644 --- a/test/cq-overflow.c +++ b/test/cq-overflow.c @@ -33,14 +33,15 @@ static int test_io(const char *file, unsigned long usecs, unsigned *drops, int f fd = open(file, O_RDONLY | O_DIRECT); if (fd < 0) { perror("file open"); - goto err; + return 1; } memset(&p, 0, sizeof(p)); ret = io_uring_queue_init_params(ENTRIES, &ring, &p); if (ret) { + close(fd); fprintf(stderr, "ring create failed: %d\n", ret); - goto err; + return 1; } nodrop = 0; if (p.features & IORING_FEAT_NODROP) From patchwork Wed Aug 10 00:31:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85229C25B06 for ; Wed, 10 Aug 2022 00:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiHJAcf (ORCPT ); Tue, 9 Aug 2022 20:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiHJAce (ORCPT ); Tue, 9 Aug 2022 20:32:34 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB2574DC4 for ; Tue, 9 Aug 2022 17:32:32 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 8E6FD80912; Wed, 10 Aug 2022 00:32:30 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091552; bh=C+Gye3EZvIlcGxNj4W91LXbelCn3L8bXgOsHnXKjJU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UAqdgiGfHa5YB4d6CoDHw57wmBfqwhGXBEUM+Fj5u+PqlMvTqqLjr27CAwdV0N9eN 7cFBMzSWSYATLotjQ63jcktuKO/M5jNRlV8OTIDJ8WHLbQqGmjl7FJfZow9U3ArLVz iZdTM/v3JZX7ACXHseCodOlASFdPK5CHXEbPJp+/Bpas0L9fPdL+eLoHa5aLGobusu +1L4MToi548jwl1tsoJ+h8UpSGyxy7/cy/PIc/qLfvuqMYBj16JPQ4g+fKjPJUTCJp vJIHHWgY9z2iVA+8nsJQXD2m13dcEd9yhbzjqx7O+bjGxn47T+1brc0vaLSJYnzBaz 9EjAm4dLj+yPw== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 02/10] test/eeed8b54e0df: Initialize the `malloc()`ed buffer before `write()` Date: Wed, 10 Aug 2022 07:31:51 +0700 Message-Id: <20220810002735.2260172-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi ... to avoid valgrind's complaint: ==3054187== Syscall param write(buf) points to uninitialised byte(s) ==3054187== at 0x4958E63: write (write.c:26) ==3054187== by 0x109283: get_file_fd (eeed8b54e0df.c:36) ==3054187== by 0x109283: main (eeed8b54e0df.c:85) ==3054187== Address 0x4a63080 is 0 bytes inside a block of size 4,096 alloc'd ==3054187== at 0x484479B: malloc (vg_replace_malloc.c:380) ==3054187== by 0x109698: t_malloc (helpers.c:22) ==3054187== by 0x109270: get_file_fd (eeed8b54e0df.c:35) ==3054187== by 0x109270: main (eeed8b54e0df.c:85) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/eeed8b54e0df.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/eeed8b54e0df.c b/test/eeed8b54e0df.c index b388b12..b8149f2 100644 --- a/test/eeed8b54e0df.c +++ b/test/eeed8b54e0df.c @@ -33,6 +33,7 @@ static int get_file_fd(void) } buf = t_malloc(BLOCK); + memset(buf, 0, BLOCK); ret = write(fd, buf, BLOCK); if (ret != BLOCK) { if (ret < 0) From patchwork Wed Aug 10 00:31:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91FF0C19F2D for ; Wed, 10 Aug 2022 00:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbiHJAci (ORCPT ); Tue, 9 Aug 2022 20:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiHJAcg (ORCPT ); Tue, 9 Aug 2022 20:32:36 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D68674E0E for ; Tue, 9 Aug 2022 17:32:35 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 2699880866; Wed, 10 Aug 2022 00:32:32 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091555; bh=99QuzWpQ2m326XNPxrLiBmn8OFsQT+YXxjXSNENxBuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hoQXYtDOqOOuKvMWB0ePrSvCChRvgip+iVXVIEo+QnqPvWnhA2wqfTJ6ZoNH3aFH7 kvR33d14jrTAHY8yNloaT4gAJ/QgZBcf3rHvrnz19tRNukabDeXkuMK75WhCbj4WEC nLNme1m/2OY1+cOG8hqqXYxTCNopooIvxodQmYlIoALtxRgN9xWS9pit80kLx4AI4N jy0d77QGrbCdYEAkwvJZUDrpaYyGBgK1L4ei464QgkmOKA0IWY5UiMyjWOJ4heZ0l9 fE2AGOtVN+gzK9Ovs2PJRT6Rfh9+U7+c7a6J8LddTGIJxz2Q/MnQ5X4IOq9c0Yw+1H YNwRL7gvSPyXg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 03/10] test/file-verify: Fix reading from uninitialized buffer Date: Wed, 10 Aug 2022 07:31:52 +0700 Message-Id: <20220810002735.2260172-4-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==3054556== Conditional jump or move depends on uninitialised value(s) ==3054556== at 0x1099DB: verify_buf (file-verify.c:48) ==3054556== by 0x10A506: test (file-verify.c:449) ==3054556== by 0x109353: main (file-verify.c:538) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/file-verify.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/file-verify.c b/test/file-verify.c index 595dafd..b1a8fd4 100644 --- a/test/file-verify.c +++ b/test/file-verify.c @@ -347,13 +347,16 @@ static int test(struct io_uring *ring, const char *fname, int buffered, void *ptr; t_posix_memalign(&ptr, 4096, CHUNK_SIZE / nr_vecs); + memset(ptr, 0, CHUNK_SIZE / nr_vecs); vecs[j][i].iov_base = ptr; vecs[j][i].iov_len = CHUNK_SIZE / nr_vecs; } } } else { - for (j = 0; j < READ_BATCH; j++) + for (j = 0; j < READ_BATCH; j++) { t_posix_memalign(&buf[j], 4096, CHUNK_SIZE); + memset(buf[j], 0, CHUNK_SIZE); + } nr_vecs = 0; } From patchwork Wed Aug 10 00:31:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940082 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A264C3F6B0 for ; Wed, 10 Aug 2022 00:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229436AbiHJAck (ORCPT ); Tue, 9 Aug 2022 20:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiHJAci (ORCPT ); Tue, 9 Aug 2022 20:32:38 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F306778208 for ; Tue, 9 Aug 2022 17:32:37 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id AB91580818; Wed, 10 Aug 2022 00:32:35 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091557; bh=Goxkml2Kgc8NNLi9Lw2CvK/OUKT6Ntuv+SVwp3+YSco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HZGJJ6xpjjSV6EwuOxol+onVm/EJGPmdKObiQe1zu1Vk8MukjW9jrsWnGS8adT7mP tLCbLovl2kaojliBG2O5zlHxk5fIUMr0st99gz2903rV40sR6J8TPLVo5dZZGnzvCD 5lqZsMHDkc2rXNZD/c60w4+vMtOCQmkoHnaiA0m8NdA2ih/IWScCsACqOD107zvNdH cr+EHyppVfkyNllJZGa8daJhxQuHfGOy9IhO/+PRw7Yva0Vk9lB6pmzLv2qdjTna9v 19A8xdgb0SCkKchP7IoztbASnz2LC02sHNZREuS8ssHtDWkECIYvcQ1L66RA/C8/HU Bz47oy4seg63A== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 04/10] test/fixed-reuse: Fix reading from uninitialized array Date: Wed, 10 Aug 2022 07:31:53 +0700 Message-Id: <20220810002735.2260172-5-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==2253268== Conditional jump or move depends on uninitialised value(s) ==2253268== at 0x109F0E: test (fixed-reuse.c:109) ==2253268== by 0x109A62: main (fixed-reuse.c:147) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/fixed-reuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixed-reuse.c b/test/fixed-reuse.c index 401251a..a248e35 100644 --- a/test/fixed-reuse.c +++ b/test/fixed-reuse.c @@ -26,7 +26,7 @@ static int test(struct io_uring *ring) { struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; - char buf[BSIZE]; + char buf[BSIZE] = { }; int ret, i; /* open FNAME1 in slot 0 */ From patchwork Wed Aug 10 00:31:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C826FC19F2D for ; Wed, 10 Aug 2022 00:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbiHJAcm (ORCPT ); Tue, 9 Aug 2022 20:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbiHJAcl (ORCPT ); Tue, 9 Aug 2022 20:32:41 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5CEE7170C for ; Tue, 9 Aug 2022 17:32:40 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 48DC380866; Wed, 10 Aug 2022 00:32:38 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091560; bh=s+qeufJzYyP7r6zLUww1VcpAkPWWD8ekEFqTI/SrShg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kh+T0N3oYbPegKbCiQfFAk+QDxc/OM6wZRItSPDDg/dXVvwKZ2UQ/Z9F0urcYqac3 OntEM+21fWX4TurFBRONgZBy64hmu99pt7uO+jYVnEFLZ4pQkhvq25YL3SIsbmZbb+ rUlI0W0n56GUYAVqb8YopuXZzkpvuJ7RjzIH/p/67cotI9AkQ3gMOKPukhYhw2Hk8w UYYi7F2w+9utOgwQBL8IoSMoyHhHGEWUDpPieSIq0uZqDumEbKRVaXIsgxWdleCcdH eDSHctJ9DdXS/oJ9dyhrz1CxBlwTQG9Is/CtxLK1ZPpNphnjPjZmhRlFMfnnU/g5JF ib5mIb+YuheIA== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 05/10] test/fpos: Fix reading from uninitialized buffer Date: Wed, 10 Aug 2022 07:31:54 +0700 Message-Id: <20220810002735.2260172-6-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==3054875== Conditional jump or move depends on uninitialised value(s) ==3054875== at 0x109898: test_read (fpos.c:109) ==3054875== by 0x109898: main (fpos.c:243) ==3054875== ==3054875== Conditional jump or move depends on uninitialised value(s) ==3054875== at 0x10987B: test_read (fpos.c:111) ==3054875== by 0x10987B: main (fpos.c:243) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/fpos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/fpos.c b/test/fpos.c index 4ffa22d..4c36f11 100644 --- a/test/fpos.c +++ b/test/fpos.c @@ -52,6 +52,9 @@ static int test_read(struct io_uring *ring, bool async, int blocksize) unsigned char buff[QUEUE_SIZE * blocksize]; unsigned char reordered[QUEUE_SIZE * blocksize]; + memset(buff, 0, QUEUE_SIZE * blocksize); + memset(reordered, 0, QUEUE_SIZE * blocksize); + create_file(".test_fpos_read", FILE_SIZE); fd = open(".test_fpos_read", O_RDONLY); unlink(".test_fpos_read"); From patchwork Wed Aug 10 00:31:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3AD8C19F2D for ; Wed, 10 Aug 2022 00:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbiHJAcq (ORCPT ); Tue, 9 Aug 2022 20:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiHJAco (ORCPT ); Tue, 9 Aug 2022 20:32:44 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BB2274DC4 for ; Tue, 9 Aug 2022 17:32:43 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id D3FEE807CA; Wed, 10 Aug 2022 00:32:40 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091562; bh=2+2WbL9YQE9VVPKsr5JbG+UxqwYgXsXaBDlTThv95To=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJLp6Zm8LXtI2WkM2BJ/tefd5jKN/5KKOROYcooCUnSebPzdfGQw2kppPH6+6K6eH bRMX7h7drssL1iWyQC2/hguGTK7JEynzIV0VJxvvQYduN4dG0EZyvphRvgdugfyedW r1qjcSdkdlXNLiSqnceVJugHZvWshzZVSaz/+DG/rrs+ry8IKJMO1Mv9RwCEs22M0M UDzSMmbIvXaQ0T6wElC+PU6K2FFRWdxtij/32VRizHcQ1eBN55r87erdmlwoeNW4Wp qhm0OEfwE07iB0tJRs3248YW4an+QPp5tb9BFYQfiAZZud+tnL1DuesZLTmTJBW8Wn zPNnOvMY3fU4g== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 06/10] test/statx: Fix reading from uninitialized buffer Date: Wed, 10 Aug 2022 07:31:55 +0700 Message-Id: <20220810002735.2260172-7-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==3062618== Conditional jump or move depends on uninitialised value(s) ==3062618== at 0x484D65E: bcmp (vg_replace_strmem.c:1129) ==3062618== by 0x109304: test_statx (statx.c:71) ==3062618== by 0x109304: main (statx.c:149) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/statx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/statx.c b/test/statx.c index 5fa086e..4ae3452 100644 --- a/test/statx.c +++ b/test/statx.c @@ -40,7 +40,7 @@ static int test_statx(struct io_uring *ring, const char *path) { struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; - struct statx x1, x2; + struct statx x1 = { }, x2 = { }; int ret; sqe = io_uring_get_sqe(ring); From patchwork Wed Aug 10 00:31:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7431C19F2D for ; Wed, 10 Aug 2022 00:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbiHJAct (ORCPT ); Tue, 9 Aug 2022 20:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiHJAcr (ORCPT ); Tue, 9 Aug 2022 20:32:47 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6349785BC for ; Tue, 9 Aug 2022 17:32:45 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 6921080866; Wed, 10 Aug 2022 00:32:43 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091565; bh=9+f0W4QhjkUwt9EAApmWkBE2818gTJuXJJcM0bJIwnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qgGRDR79iVlhg+BTq2gFol/6E3bAMskVnN0n6yWufbMPTysIjNtFOkx+EGxknUxN9 0rYpfxN/LXEU2VUDgvR9HU2enFlk8R8T1AuEngHmw/N2wE4zDa90rQl0A+tgacm1LD ut9OjW4Ogjl3+DgPFzsHJaOm5VcVIv9dxwr4BbBTRx3+C3HKqsj4gGM08k9yITUSZM ihApcrZprquDiZkeyh0iijjY36ETl01RVkhjadYBVZYzjNj1BJ8VoXXh/WpwnY8Ccl AJ+kvS71IJF0pJf1jMV6joZ7PCDwi2n29CuOIgXbgS32efyo+7KMGhYkvQUFtGv2gI RivG4VTTa6dsQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 07/10] test/submit-link-fail: Initialize the buffer before `write()` Date: Wed, 10 Aug 2022 07:31:56 +0700 Message-Id: <20220810002735.2260172-8-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi ... to avoid valgrind's complaint: ==2254978== Syscall param write(buf) points to uninitialised byte(s) ==2254978== at 0x498EA37: write (write.c:26) ==2254978== by 0x109F17: test_underprep_fail (submit-link-fail.c:82) ==2254978== by 0x109F17: main (submit-link-fail.c:141) ==2254978== Address 0x1ffefffb07 is on thread 1's stack ==2254978== in frame #1, created by main (submit-link-fail.c:123) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/submit-link-fail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/submit-link-fail.c b/test/submit-link-fail.c index 45f6976..e62f793 100644 --- a/test/submit-link-fail.c +++ b/test/submit-link-fail.c @@ -23,7 +23,7 @@ static int test_underprep_fail(bool hardlink, bool drain, bool link_last, struct io_uring ring; struct io_uring_sqe *sqe; struct io_uring_cqe *cqe; - char buffer[1]; + char buffer[1] = { }; int i, ret, fds[2]; if (drain) From patchwork Wed Aug 10 00:31:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 527B5C25B06 for ; Wed, 10 Aug 2022 00:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbiHJAcu (ORCPT ); Tue, 9 Aug 2022 20:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiHJAct (ORCPT ); Tue, 9 Aug 2022 20:32:49 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4682C7171D for ; Tue, 9 Aug 2022 17:32:48 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id F2B9F807CA; Wed, 10 Aug 2022 00:32:45 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091568; bh=lyFfyENiq0OH6kvBtip9CN5cUUu7Lv3+VKwr5q2xZ78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fpRwXyryGFVTLNIgf8jaC/NdTTFGQS6mCbD32dkW+kTqfpRncbW3XOpAWWnA7rVpW /bxfoVkzm1NJjLmsr7eHld0bdEN0CktjNAkLRdOCEjSUr6DzdFVlKNRYoXTqRoM0jl 2x0a+I/ftk/3kSnr4udzOgOPLTh/kY/4wLaiCTce+1hG1XZKX5GEuAUg+4HRvil7tG vaCaRE3OL9VChpQx2fDKVT0j+hY4TCfSNW/H5IokT4TkTshK6eqT2MyloBR7fvL+fx WrkTwvmycP9xuGhEI2Y8HlzQvkuOjvjZXD24F4UGMsf0yNkkPSbNcDd6ZSUTX9vmlX m72fH9IBVXN+w== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 08/10] test/232c93d07b74: Fix reading from uninitialized buffer Date: Wed, 10 Aug 2022 07:31:57 +0700 Message-Id: <20220810002735.2260172-9-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==2255860== Thread 2: ==2255860== Conditional jump or move depends on uninitialised value(s) ==2255860== at 0x10A073: rcv (232c93d07b74.c:150) ==2255860== by 0x490EB42: start_thread (pthread_create.c:442) ==2255860== by 0x499FBB3: clone (clone.S:100) ==2255860== ==2255860== Conditional jump or move depends on uninitialised value(s) ==2255860== at 0x10A0B6: rcv (232c93d07b74.c:150) ==2255860== by 0x490EB42: start_thread (pthread_create.c:442) ==2255860== by 0x499FBB3: clone (clone.S:100) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/232c93d07b74.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/232c93d07b74.c b/test/232c93d07b74.c index c99491f..4dc12c1 100644 --- a/test/232c93d07b74.c +++ b/test/232c93d07b74.c @@ -121,7 +121,7 @@ static void *rcv(void *arg) int done = 0; while (!done && bytes_read != 33) { - char buff[RECV_BUFF_SIZE]; + char buff[RECV_BUFF_SIZE] = { }; struct iovec iov; iov.iov_base = buff; From patchwork Wed Aug 10 00:31:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51B9AC19F2D for ; Wed, 10 Aug 2022 00:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbiHJAcw (ORCPT ); Tue, 9 Aug 2022 20:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiHJAcv (ORCPT ); Tue, 9 Aug 2022 20:32:51 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A40A7AC22 for ; Tue, 9 Aug 2022 17:32:51 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 83F8F80866; Wed, 10 Aug 2022 00:32:48 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091570; bh=UAM+iegT+0YgZACF4mFDrxf/kclbwpYnTqerz3nIjfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkqJeGy2RbvDIf9YjRMLGCA5AguQ1iW2wdWjBStKv/ZH7xYO8A459Ta8i2C/jrY2W WaMyjf0VQ6HVQ7Nzq0d2ALE1Z0DoRdKyhdLglEqPwv/EBo7tTsZFEIh7Z2n+TdpMzl /yvSelRATGPH5OyKkYWBK9LQIl2oOkcPVWUIFXkLNpLL6tedIXR77a99/ootBsIA5G AViFowLr48fVtZGL9oxAcX0UjJw4Tc1CDYxuOJ2U1PNNaegOhyr0VHLFwjPnm9SeL6 iwkZILYphXSVShM8Ms8t6N8oNpi1ymo2zWFA+8d4HfFZMBwFDnr1zDSdLgOwNvbO9c 8vRMugeME8yUA== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 09/10] test/eventfd-disable: Fix reading uninitialized variable Date: Wed, 10 Aug 2022 07:31:58 +0700 Message-Id: <20220810002735.2260172-10-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==2256099== Conditional jump or move depends on uninitialised value(s) ==2256099== at 0x109DF5: main (eventfd-disable.c:136) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/eventfd-disable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/eventfd-disable.c b/test/eventfd-disable.c index 2c8cf6d..9de2465 100644 --- a/test/eventfd-disable.c +++ b/test/eventfd-disable.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) struct io_uring_sqe *sqe; struct io_uring_cqe *cqe; struct io_uring ring; - uint64_t ptr; + uint64_t ptr = 0; struct iovec vec = { .iov_base = &ptr, .iov_len = sizeof(ptr) From patchwork Wed Aug 10 00:31:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B53C1C19F2D for ; Wed, 10 Aug 2022 00:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiHJAc4 (ORCPT ); Tue, 9 Aug 2022 20:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiHJAcy (ORCPT ); Tue, 9 Aug 2022 20:32:54 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 920807C184 for ; Tue, 9 Aug 2022 17:32:53 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 16F2E807CA; Wed, 10 Aug 2022 00:32:50 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091573; bh=6G26TH3u8k3JCLyT8Jc7GHih4BvnsCUEfWTRbUwRZ+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AosnPtO6hlMFRmapzSsNK1ZnTodMdNq8zZpfJIJ7ZWfG18PrXNg1D4gWXuI5N7ua1 teSXnRY5X4aIXFFbgnpj+SzETi7YY6rtDgpr4DE8MAkUbKV3qI9C12ZnKETIcDMOtv HcWiOBYZoi9THiqa8nzOv+6/RFv0L4dhmmPZ4Xi9Tgb/ZNNcyumaVLVCwi8HlhAnhN fya/SfAJM8Jufd48xzbInE5uteCwv2rdvV8Q1z30syrUIaI8Mv0dQvO6rL3CuStttA eDhQIl9xambDZXPecEyWIA8SngXoihRZCk1xfLngh6T5tjJnwgbjbD1x1zYIdnrFzC /iorHjPaCx1QQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 10/10] test/file-register: Fix reading from uninitialized buffer Date: Wed, 10 Aug 2022 07:31:59 +0700 Message-Id: <20220810002735.2260172-11-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Fix this: ==2256677== Conditional jump or move depends on uninitialised value(s) ==2256677== at 0x485207E: bcmp (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==2256677== by 0x10BEAE: test_fixed_read_write (file-register.c:489) ==2256677== by 0x10AED2: test_skip (file-register.c:595) ==2256677== by 0x10AED2: main (file-register.c:1087) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/file-register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/file-register.c b/test/file-register.c index 634ef81..0a8aa57 100644 --- a/test/file-register.c +++ b/test/file-register.c @@ -431,7 +431,7 @@ static int test_fixed_read_write(struct io_uring *ring, int index) iov[0].iov_len = 4096; memset(iov[0].iov_base, 0x5a, 4096); - iov[1].iov_base = t_malloc(4096); + iov[1].iov_base = t_calloc(1, 4096); iov[1].iov_len = 4096; sqe = io_uring_get_sqe(ring);