From patchwork Mon Sep 16 10:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1986084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=K0Cqy89D; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=t2Sngj5G; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=K0Cqy89D; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=t2Sngj5G; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X6hY82nq5z1y2Y for ; Mon, 16 Sep 2024 20:51:24 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 0441A3C2BD3 for ; Mon, 16 Sep 2024 12:51:21 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 475AF3C025C for ; Mon, 16 Sep 2024 12:51:18 +0200 (CEST) Authentication-Results: in-2.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.223.130; helo=smtp-out1.suse.de; envelope-from=schwab@suse.de; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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-2.smtp.seeweb.it (Postfix) with ESMTPS id 8FD04600459 for ; Mon, 16 Sep 2024 12:51:17 +0200 (CEST) Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by smtp-out1.suse.de (Postfix) with ESMTP id BE11221AE7 for ; Mon, 16 Sep 2024 10:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1726483876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=wx6LDzP7CQtW648bPvtW7JympnHKXF/kP3BwplDSZs8=; b=K0Cqy89Dm2a/fVdawohCEBlBK2h7w5BQLbsrjDS0yGgNYCaUmGPxyHdc5hbji5811l83eS 6rqbr1ReBiy1RlRKhD5NGZFLIlefB/tGs3JvhIkXnIu7zzLQJcrV4RlH7nGsH7cVF4KoDb H34KebHeP2+LbF9skrlEVNWK7NE0kB4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1726483876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=wx6LDzP7CQtW648bPvtW7JympnHKXF/kP3BwplDSZs8=; b=t2Sngj5Gngu6TgNZLwasqpwEncT7saN56If9QcSzOZweh5jUralPivMpBbttXv3zzogN0f +zQ3TuR8W887h3Cg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1726483876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=wx6LDzP7CQtW648bPvtW7JympnHKXF/kP3BwplDSZs8=; b=K0Cqy89Dm2a/fVdawohCEBlBK2h7w5BQLbsrjDS0yGgNYCaUmGPxyHdc5hbji5811l83eS 6rqbr1ReBiy1RlRKhD5NGZFLIlefB/tGs3JvhIkXnIu7zzLQJcrV4RlH7nGsH7cVF4KoDb H34KebHeP2+LbF9skrlEVNWK7NE0kB4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1726483876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=wx6LDzP7CQtW648bPvtW7JympnHKXF/kP3BwplDSZs8=; b=t2Sngj5Gngu6TgNZLwasqpwEncT7saN56If9QcSzOZweh5jUralPivMpBbttXv3zzogN0f +zQ3TuR8W887h3Cg== Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id ACC4B4A0146; Mon, 16 Sep 2024 12:51:16 +0200 (CEST) From: Andreas Schwab To: ltp@lists.linux.it X-Yow: I am NOT a nut.... Date: Mon, 16 Sep 2024 12:51:16 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-4.20 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.985]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid] X-Spam-Score: -4.20 X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-2.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH] getdents: account for d_name size in tst_dirp_size 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The linux_dirent and linux_dirent64 structs do not contain space for the d_name member. Add NAME_MAX to the size in tst_dirp_size so that the getdents syscalls do not spuriously fail with EINVAL instead of EFAULT. Signed-off-by: Andreas Schwab Acked-by: Jan Stancek --- testcases/kernel/syscalls/getdents/getdents.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h index 560df4126..02c3bc509 100644 --- a/testcases/kernel/syscalls/getdents/getdents.h +++ b/testcases/kernel/syscalls/getdents/getdents.h @@ -64,9 +64,9 @@ tst_dirp_size(void) { switch (tst_variant) { case 0: - return sizeof(struct linux_dirent); + return sizeof(struct linux_dirent) + NAME_MAX; case 1: - return sizeof(struct linux_dirent64); + return sizeof(struct linux_dirent64) + NAME_MAX; #if HAVE_GETDENTS case 2: return sizeof(struct dirent);