From patchwork Wed Jun 14 15:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Sionneau X-Patchwork-Id: 1795012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sionneau.net header.i=@sionneau.net header.a=rsa-sha256 header.s=selectormx4 header.b=rvHaHgyZ; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (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 4Qh8ct4YQkz20WR for ; Thu, 15 Jun 2023 01:35:09 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 232313520B07; Wed, 14 Jun 2023 17:35:02 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sionneau.net header.i=@sionneau.net header.a=rsa-sha256 header.s=selectormx4 header.b=rvHaHgyZ; dkim-atps=neutral Received: from mx4.sionneau.net (mx4.sionneau.net [51.15.250.1]) by helium.openadk.org (Postfix) with ESMTPS id 984CC3520B01 for ; Wed, 14 Jun 2023 17:34:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sionneau.net; s=selectormx4; t=1686756897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aoauTnKOp+A1llAL9K6Wj2kIzFvflUnDfkb9Ravf8PM=; b=rvHaHgyZI7+hHmHOY5QZZq7COGZEAPrdih6hCXRLvHqJ2/+xDG4aVgDXiKRNEsOhSteLVG UuW9rXqYVg87iVixAxTEitOe9g9b6Qq2EIExq48DGvLiZMYvGHPoSMZ4OGiwwYUvuPzjby pY4RxDZ7rmJ6+C29d6wIzgXi+bBLGic= Received: from fallen-ThinkPad-X260.home (91-171-21-26.subs.proxad.net [91.171.21.26]) by mx4.sionneau.net (OpenSMTPD) with ESMTPSA id 176d2e9c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 14 Jun 2023 15:34:57 +0000 (UTC) From: Yann Sionneau To: devel@uclibc-ng.org Date: Wed, 14 Jun 2023 17:34:40 +0200 Message-Id: <20230614153440.7306-1-yann@sionneau.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: CUF66WTVWXHMZ5HNVZVF73VD33ZEFRXD X-Message-ID-Hash: CUF66WTVWXHMZ5HNVZVF73VD33ZEFRXD X-MailFrom: yann@sionneau.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Yann Sionneau X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] Fix exec-null test for newer kernels List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Yann Sionneau Without this patch, since https://github.com/torvalds/linux/commit/dcd46d897adb70d63e025f175a00a89797d31a43 this test runs in infinite loop. Signed-off-by: Yann Sionneau --- test/unistd/exec-null.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unistd/exec-null.c b/test/unistd/exec-null.c index 3df99f3..0f79b3d 100644 --- a/test/unistd/exec-null.c +++ b/test/unistd/exec-null.c @@ -4,7 +4,12 @@ int main(int argc, char *argv[]) { - if (argc == 0) + /* since Linux https://github.com/torvalds/linux/commit/dcd46d897adb70d63e025f175a00a89797d31a43 + * kernel forces an empty first arg if execve is called + * with argv == NULL. + * so we need to handle argc == 1 for newer kernel as well + */ + if (argc == 0 || argc == 1) return 0; char *exec_argv[1], *exec_envp[1];