From patchwork Thu Dec 21 18:59:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 757033 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp1054498wrw; Thu, 21 Dec 2023 11:00:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhOeEU3THckm+UP+ctV8RxEjsvR2hlT8lxD4Oto7vRYWOmF4VdF1nlTLEP2rlCcwC8c84d X-Received: by 2002:a67:e715:0:b0:466:b2ae:2b30 with SMTP id hw21-20020a67e715000000b00466b2ae2b30mr58713vsb.46.1703185253149; Thu, 21 Dec 2023 11:00:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703185253; cv=pass; d=google.com; s=arc-20160816; b=Pfy+dWzj9ovGnTytFOdO3skxuuKcb/3tgng2gaOYSESqds0FF1qwtdcVXxZY1+yFGD 1O5fgPcsuIoGZYSu10JdMaQo9T5DM2E65rWayIPbZ9SOlrmtZy/10Jzjx1/qHm+JTbDw GRNmyVX0pCuUHuyL3oUV7Vng7DNrD0ECq1lqfWH0K8lKiHXBSYzhavGlmH5Sec7e8TJ7 DKXnyh56q7Uiys+U7A6uiqJEM2wb6VRi0L74I9g1pud0B399hgdhgCwrXwwcS1X8M4Rj HF8Usp5BTk8MORHsp7374jcAELy4MNuA6iC6JSIFF6uDccru18MghDNZjfW7cKYu5NaO Zf3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=TLl4uZ5zM2ZP/IqJmVIBfhvMkBEXhdbPBgEsRG414Go=; fh=JNN3k7BRNI1OnWdIBK9jlpNeitGd8uBm02dHI75AGcg=; b=J0AVoFtUz80xHhhbmIJWz0l/Q5IBsBTIH0KWkzc1KpidaCiVJDJHmozHiQd06nLfSP Y7aUXYZMizRwch/WhagZ0JvRfFpiC/dtcdb64srrDidAQjKVtcSlRRx9ANjdgAP0HDVj 9gTRYqApA4AtQ3C8rzaOTi2cdKRh6nAqDa7W+usekulEAJsxVsLxMKocNdge8Y10sPV8 ml1n0XMohJm3rbEgfkMgwK1Af3kcwwfJw7EbCVZpW7wOQBuIf1Cvtx0uTjebdLFs+H6g NKqwx10SyrlYPpUH1jogf6EGN+zN37+w69CRlZXyuzrfr78ydILN8ru1+Xp/HzLU7qnz 5vsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGpJDdGE; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q25-20020a67f059000000b0046618ebde59si516746vsm.606.2023.12.21.11.00.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 11:00:53 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGpJDdGE; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67B353848373 for ; Thu, 21 Dec 2023 19:00:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 19B5D386186B for ; Thu, 21 Dec 2023 18:59:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19B5D386186B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 19B5D386186B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703185189; cv=none; b=JXFe4SNIR7YhAUZvJ1/wl5m0+pXQxMXwslqUT/e1OaxrMutYOOO8satb3/ovh6tYpWcqAn5vR8+jU4XawTgQJBjukBcsYPEqNan154N5WtVtvAq+otlQFcmYIv15z6IO+TvVk58UoAYaeUSd4VnhcLf75Q3ZIsQj2QL9RRycM98= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703185189; c=relaxed/simple; bh=hhgC2bh0eGBgUHbOSRieTVdEAFQFRzxIdryVK+6f7LI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=T1nKeHKXT1EM8lGe20nUrv9ouE7smD7UMLc12Dc867pc+csHMOzAVlcXoiu/rz06bKL+5TX3kNgqvN76UfNJPHFTTE/QoHtKJJ9cHTevEy8ahgjQXxl8jzhARJBAYa5BHv2ypWPEmBtlSsyXPC4Yjpa07hgRrSGdswE06N9gLW0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-2043e721daaso129800fac.2 for ; Thu, 21 Dec 2023 10:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703185186; x=1703789986; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TLl4uZ5zM2ZP/IqJmVIBfhvMkBEXhdbPBgEsRG414Go=; b=kGpJDdGEkjMg3+Qg0UJbLYlUP0r4yKv2ia5V/lrEq/B6JKvt1kslxtXoPNCqRktmCl vtUEZ2t9QNllLKz3otwRiSvaJowFryFEWMySf7/CxciO1LT4sPXcB43yeE6xgoMdk1jd XuH+aY93JrfdD5AWQ3PKcjU1i80A1FdXcV+nhDFdLbI97Iw4pnKylMeNEoXzps2tH2ib dQUL5yLAypnK4bPqI1nUYUxjvCtqFuPjBGkQnZaBe+vLSSimMGxAOCp8Ma/ZqBfLnDvF RJL62cZCtIql9Lh++6hL0dwBssQQm0/B25yIqNPI3s7PxNfmQB+LL0nn+tbIhAy2DTpe 6gKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703185186; x=1703789986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TLl4uZ5zM2ZP/IqJmVIBfhvMkBEXhdbPBgEsRG414Go=; b=LXczs7twgAa/jLYC3kWJzHQneO+LtrHbTwNj2iH7ayuFSfkFdMTTyA5n35qDpNmeJX syUTsfAKGTqdJxQ++2iqHU41mQwBGa870qSdEF2N4Yds+323jOE0eig63I3VKdRLbW29 yEFdv9zus0Ly8HZeYVTZN+n9jvMI3YdhLWYbaLpiaOBHYmwTXG/Ye41QQAREhVY4F4Tg vlCt5BtB2LS31k8fCwlrU0jzKCvCBdqbXQZu/0XXd7iZbIT5ArXgKyNTpNb07Rd22NCO vzKXDGzVmqmPQ66gXBm+hRHHb/U21Ml7SzBFQUrIaf/gtEIXxz48nFay9j/OLR/AtOIn 9skA== X-Gm-Message-State: AOJu0Yx+wggxMmaHgYxflyj7Oe742wtsA9BSg/f+iUOqFmSRq6MKVi5g UGvykO1MQdk4idx10A+DXzVT+xcwdVFCFmdnlQP0nwOycSo= X-Received: by 2002:a05:6870:f149:b0:1fb:75a:6d1a with SMTP id l9-20020a056870f14900b001fb075a6d1amr277724oac.65.1703185186244; Thu, 21 Dec 2023 10:59:46 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c0:8192:ecd7:d327:bea0:14dc]) by smtp.gmail.com with ESMTPSA id a9-20020a63e409000000b005cdbebd61d8sm1946165pgi.9.2023.12.21.10.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:59:45 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Siddhesh Poyarekar Subject: [PATCH 02/15] debug: Increase tst-fortify checks for compiler without __va_arg_pack support Date: Thu, 21 Dec 2023 15:59:16 -0300 Message-Id: <20231221185929.1307116-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221185929.1307116-1-adhemerval.zanella@linaro.org> References: <20231221185929.1307116-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org The fortify wrappers for varargs functions already add fallbacks to builtins calls if __va_arg_pack is not supported. Checked on aarch64, armhf, x86_64, and i686. Reviewed-by: Siddhesh Poyarekar --- debug/tst-fortify.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/debug/tst-fortify.c b/debug/tst-fortify.c index 20e926751a..5cd9d22feb 100644 --- a/debug/tst-fortify.c +++ b/debug/tst-fortify.c @@ -130,7 +130,7 @@ static int num2 = 987654; chk_fail_ok = 0; \ FAIL (); \ } -#if __USE_FORTIFY_LEVEL >= 2 && (!defined __cplusplus || defined __va_arg_pack) +#if __USE_FORTIFY_LEVEL >= 2 # define CHK_FAIL2_START CHK_FAIL_START # define CHK_FAIL2_END CHK_FAIL_END #else @@ -419,7 +419,6 @@ do_test (void) stpncpy (buf + 6, "cd", l0 + 5); CHK_FAIL_END -# if !defined __cplusplus || defined __va_arg_pack CHK_FAIL_START sprintf (buf + 8, "%d", num1); CHK_FAIL_END @@ -439,7 +438,6 @@ do_test (void) CHK_FAIL_START swprintf (wbuf + 8, l0 + 3, L"%d", num1); CHK_FAIL_END -# endif memcpy (buf, str1 + 2, 9); CHK_FAIL_START @@ -550,7 +548,6 @@ do_test (void) FAIL (); } -# if !defined __cplusplus || defined __va_arg_pack CHK_FAIL_START sprintf (a.buf1 + (O + 7), "%d", num1); CHK_FAIL_END @@ -562,7 +559,6 @@ do_test (void) CHK_FAIL_START snprintf (a.buf1 + (O + 7), l0 + 3, "%d", num2); CHK_FAIL_END -# endif memcpy (a.buf1, str1 + (3 - O), 8 + O); CHK_FAIL_START