From patchwork Mon Sep 16 09:29:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1986056 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=S3STeJqg; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AUwoqTCY; 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=S3STeJqg; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AUwoqTCY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; 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 [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X6fl84VP9z1y1m for ; Mon, 16 Sep 2024 19:29:56 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id DECB23C2B7D for ; Mon, 16 Sep 2024 11:29:53 +0200 (CEST) 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 [IPv6:2001:4b78:1:20::4]) (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 314573C094B for ; Mon, 16 Sep 2024 11:29:50 +0200 (CEST) Authentication-Results: in-4.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=2a07:de40:b251:101:10:150:64:1; helo=smtp-out1.suse.de; envelope-from=schwab@suse.de; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) (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 97C981007C94 for ; Mon, 16 Sep 2024 11:29:49 +0200 (CEST) Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by smtp-out1.suse.de (Postfix) with ESMTP id 305F021BCB for ; Mon, 16 Sep 2024 09:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1726478988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=qMxFEx16qnwdtx5c73SfmdtMweVbPZsKQ5aEyg6Br2k=; b=S3STeJqgpsBH3nEOoZ0NSOoIMAAHb3EOnbnts+BAwl09z3+h09ieMNV8dH10edsUQcIG+X LnFjoh4n4pSYkm3uQrC1yvsb40yHPzUbAm3xzxJiAXPHW7qUpzZOAP7m9SDSMosV/etdmf TW7mjrVODDJfdqRng0hnxgS3rKp6GTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1726478988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=qMxFEx16qnwdtx5c73SfmdtMweVbPZsKQ5aEyg6Br2k=; b=AUwoqTCYGfzV3n5UDeVMqnzUOz2He8WDdlQyfeR6JKPMsmAlq+O7T/6k4XFLWe+01NA7f6 SHlO1/kMGYI2K6DQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1726478988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=qMxFEx16qnwdtx5c73SfmdtMweVbPZsKQ5aEyg6Br2k=; b=S3STeJqgpsBH3nEOoZ0NSOoIMAAHb3EOnbnts+BAwl09z3+h09ieMNV8dH10edsUQcIG+X LnFjoh4n4pSYkm3uQrC1yvsb40yHPzUbAm3xzxJiAXPHW7qUpzZOAP7m9SDSMosV/etdmf TW7mjrVODDJfdqRng0hnxgS3rKp6GTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1726478988; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=qMxFEx16qnwdtx5c73SfmdtMweVbPZsKQ5aEyg6Br2k=; b=AUwoqTCYGfzV3n5UDeVMqnzUOz2He8WDdlQyfeR6JKPMsmAlq+O7T/6k4XFLWe+01NA7f6 SHlO1/kMGYI2K6DQ== Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id 20DAF4A0146; Mon, 16 Sep 2024 11:29:48 +0200 (CEST) From: Andreas Schwab To: ltp@lists.linux.it X-Yow: DIDI... is that a MARTIAN name, or, are we in ISRAEL? Date: Mon, 16 Sep 2024 11:29:48 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-4.19 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.19)[-0.925]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; FROM_HAS_DN(0.00)[] X-Spam-Score: -4.19 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_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-4.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. 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);