From patchwork Wed Jan 18 13:36:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1728253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=deBJ/6vQ; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KEFKp7un; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NxmwW0RPmz23gM for ; Thu, 19 Jan 2023 00:35:21 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 621DE3CB4AB for ; Wed, 18 Jan 2023 14:35:14 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id C12AD3C13C2 for ; Wed, 18 Jan 2023 14:35:11 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 193CF1000A2E for ; Wed, 18 Jan 2023 14:35:10 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9A67A5BEB1; Wed, 18 Jan 2023 13:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1674048908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tflJJ5Clz2VtNI5NgGk4GdblraCFFbMTr0+CKZ9qeWw=; b=deBJ/6vQtAleXVaD9bnaunuOiRc0WmCZpyTuRRCtb+aIX2Vjdmtku9IbyNCEkzO7VW68tZ VBwg6h1O4BQdXCIW1Nc8HlpiP7TxpPX4Dpm7MxOFwA2CmLSCwyLozggCv5G7tlX+BK31XJ oqqO3JlokKhGAMslI+KrNrs8Yv7DcJo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1674048908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tflJJ5Clz2VtNI5NgGk4GdblraCFFbMTr0+CKZ9qeWw=; b=KEFKp7unjeViRNQUScA7yjfpypVzJOAO1waEKNjwKEmSzrnsHIUxfD6rqi2N38UL7Ir2LI 7fdINBdsYCf18lCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 81151139D2; Wed, 18 Jan 2023 13:35:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id t5bcHYz1x2OAQwAAMHmgww (envelope-from ); Wed, 18 Jan 2023 13:35:08 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Wed, 18 Jan 2023 14:36:43 +0100 Message-Id: <20230118133643.11371-1-chrubis@suse.cz> X-Mailer: git-send-email 2.38.2 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH] syscalls/statvfs01: Correcly zero terminate the strings X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Palethorpe Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Fixes random failures caused by the fact that the stack is not guaranteed to be zeroed. Fixes: e305ac4a305f ("statvfs01: Convert to new LTP API") Signed-off-by: Cyril Hrubis CC: Petr Vorel CC: Richard Palethorpe CC: Avinesh Kumar Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/statvfs/statvfs01.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testcases/kernel/syscalls/statvfs/statvfs01.c b/testcases/kernel/syscalls/statvfs/statvfs01.c index dd14d6a0e..f17dc4cfa 100644 --- a/testcases/kernel/syscalls/statvfs/statvfs01.c +++ b/testcases/kernel/syscalls/statvfs/statvfs01.c @@ -38,6 +38,9 @@ static void run(void) memset(valid_fname, 'a', valid_len); memset(toolong_fname, 'b', valid_len + 1); + valid_fname[valid_len] = 0; + toolong_fname[valid_len+1] = 0; + TST_EXP_FD(creat(valid_fname, 0444)); SAFE_CLOSE(TST_RET);