From patchwork Thu Mar 21 18:25:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 1914581 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=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NqUj3wR7; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V0v726nSyz1yWs for ; Fri, 22 Mar 2024 05:26:38 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B72F83CFBC0 for ; Thu, 21 Mar 2024 19:26:31 +0100 (CET) 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 035DD3C0E54 for ; Thu, 21 Mar 2024 19:26:24 +0100 (CET) Authentication-Results: in-2.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=jstancek@redhat.com; receiver=lists.linux.it) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 F2DA1601071 for ; Thu, 21 Mar 2024 19:26:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711045582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UjTD4g8c/Wq0FPSToCK+sKDLNwg/I5qbgq+63Hdw0rM=; b=NqUj3wR7RT1jvXPQdrxAMxwG5NxJ+tSMt+Go6LusNBjRiE9dQPQ+vkuS+sCnmvHe/43atk BxM1m7xLheUIeby2sQ7AOiTl4jP6PvHpf+Et8esZNQ6cai0F+zJomjZEhL1TDqllbOMf1q FZS51+0zP2GoMHqgtb4TwRIqE4o1D2Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-wBNM8NcoPvuwNio6FBFNIg-1; Thu, 21 Mar 2024 14:26:20 -0400 X-MC-Unique: wBNM8NcoPvuwNio6FBFNIg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B653800267 for ; Thu, 21 Mar 2024 18:26:20 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.226.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1CD23C20; Thu, 21 Mar 2024 18:26:19 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it Date: Thu, 21 Mar 2024 19:25:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 v2] syscalls/timer_getoverrun01: use kernel_timer_t type 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: liwan@redhat.com Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Testcase is failing on s390x, with glibc-2.39 and 6.9-rc0 (git commit a4145ce1e7bc). Userspace defines timer_t as void * (8 bytes), while __kernel_timer_t is defined as int (4 bytes). This means that kernel only populates 4 bytes, and other 4 can remain uninitialized, possibly containing some non-zero garbage, e.g.: timer_create(CLOCK_REALTIME, {sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}, <... timer_create resumed>[0]) = 0 timer_getoverrun(1 timer_getoverrun resumed>) = -1 EINVAL (Invalid argument) timer_delete(1) = -1 EINVAL (Invalid argument) Since we are dealing with syscalls directly, use kernel_timer_t. Signed-off-by: Jan Stancek Reviewed-by: Li Wang Reviewed-by: Petr Vorel --- .../kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c index 5c444857aaa7..57c2147bf47f 100644 --- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c +++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c @@ -19,10 +19,11 @@ #include #include "tst_safe_clocks.h" #include "lapi/syscalls.h" +#include "lapi/common_timers.h" static void run(void) { - timer_t timer; + kernel_timer_t timer; struct sigevent ev; ev.sigev_value = (union sigval) 0;