From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 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) 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 Content-Transfer-Encoding: 8bit List-Id: 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"); -- Ammar Faizi