From patchwork Fri Jun 28 19:20:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 808282 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp527818wrr; Fri, 28 Jun 2024 12:20:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBCWXjkTlSoDufGaLfWwqTOVJDtYi/VmNJBMuAFBxN6WuQ1v/DPPUi4zWAh9dg49j+Nh5LZbiY5PbKW1q0L9YA X-Google-Smtp-Source: AGHT+IFVO45vPnTmCHIrgEy9DFsEKmTEKf5jqzrxkb6gbPKRCyRnljU1/mT2r8F0L9kZjEej23p7 X-Received: by 2002:a05:620a:46a6:b0:79d:6905:5abc with SMTP id af79cd13be357-79d69056cfdmr367885285a.27.1719602436069; Fri, 28 Jun 2024 12:20:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1719602436; cv=pass; d=google.com; s=arc-20160816; b=YaTw12yoy8p0fD+1AGyyemtmbQotMKvdgjVW2hrtxlXUTc3LacdSNrlQC5vclrk2Ce l0X+2xwfkqViDrTrRvgiZqhqZEBDP0N+fSoRDg/5/OnQI2Rz/qGC1KDDbVJ6ZP1H3ZpA OdOtGmnG1Q9DAMLbmzGu3SyhtnpY9wj94lVFaWN0M9czESx3mJupMWt77LpRhNA/t6jI 5S/tf2E0xfPbE2YdBbC9uo5KN2art5EMbUl2PuqiOy4IuVpLqfc/GwB1lJvcJ+aaGqfo egSfB3ALDgp+V2OQ6x4I601q0zMmP5oeL9WPiZTHxozOj90TZPiFuq/ThGc1kw6SuHpS UrsA== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=V4ZG85BxRMXZba2URonGVLHNXdJWYPxI6YRwC/7HS1g=; fh=KB0OPycOJdCInX1nDEXFfy0M5ixXnsWAZ87F/u4DCeg=; b=zFT+PIcyNwL8PRzw/4xWlxBY7YvmdDug9/AzewwF4hXFbebzHY5MEnbJjSFnyK6iPQ lSW83ROE4s5G+Pjx7WB12jDbQywY/aFkkKqmTfAfp4MR9o5KNVSScdnG1X+kOrg+AZZW BIaRf1sbtG0q2+SheNkw4RSXipQjdRndkARuNIG9G+sDy4fVtmzlWHgjRfyHgx5Dbp0l 020vmZ+qz7lrh/4bcobP89YV9DPaj2aWdC+dUHQISNUIk+3AOim477uvmm1oPxADlAx7 E7v6Ct9cj+7fXcum4hNF1stlogsawxHHNGYoWq8lrR+RfCETRdm2n4XZmLvJVTfh3x4w U6hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WK8pn/fT"; 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 af79cd13be357-79d6934c904si281778685a.725.2024.06.28.12.20.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 12:20:36 -0700 (PDT) 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="WK8pn/fT"; 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 B2D5E3826DF9 for ; Fri, 28 Jun 2024 19:20:35 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 6C7323826DC7 for ; Fri, 28 Jun 2024 19:20:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C7323826DC7 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 6C7323826DC7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719602427; cv=none; b=cKLpYbtp1Dd0kbH92GTz3lpANs9f8C1cqKyUGjFV40u1iGKsIj+Tjjk89YtB5EhnIy0lvsC9cQ94D5mM686omcitI4ErPUkOcTOU5XtLuGE1PNMQCyM1iFDVTo+ogLeAt+yCq0Bi0TXpOcet3N0SZBR3cd7CrgdPV0ul2j19Ir8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719602427; c=relaxed/simple; bh=vr+BgWsOBG1VkGZoAv0FZQSN3epTKRbvQisoPf/fPOE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kTgG0zr+oZshmGV0/zsy8Z0BSSHWvdPFYg/GXI6zBH7wA7PrLkZe3McQeZOAp17SW70+BRJ8vnHnPdjAdfeuCc7Xt3YOAk25uji1rrfNtC4DpwUtXHEzeITf4XdisO7LUu7rgXfRnHexsI7OiijgJhlp6gb8ZNRMXDdLE8UXuaY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-701b0b0be38so804445b3a.0 for ; Fri, 28 Jun 2024 12:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719602424; x=1720207224; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=V4ZG85BxRMXZba2URonGVLHNXdJWYPxI6YRwC/7HS1g=; b=WK8pn/fTJgPcwtCOP2Aj88Adk1XYELf6cR0W+fvYnk21nSGHCMFXodeVqgAL6xeeoc IacYCjusrCzvGnssFMBkf8nYUY3atErXuHnXfscnToQmn/VoOfrDvnnO6qUIEKANoaus LeANlWKggBCTGT5aoCxafIK1yISE6gUcoAaECtALuy+jhg1GtVIaesMMbjGd+VL62hpf jzgpVZbEGWTw2qPNmDKmIL8SviJOddDaNce1KbeP+rxv9HU+YgQHk70g2KuP38ZMEYvT A6YlcdGEdfsGeb//Kz3iejwsam/t8g9kn0L3Dldr3eWghiH1JnD1Ix0sLBFXvMUOppkJ D2Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719602424; x=1720207224; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V4ZG85BxRMXZba2URonGVLHNXdJWYPxI6YRwC/7HS1g=; b=UHOBb3xOyeEfqPFeEY0OiUuOp1FkMhe94noaGK0wSDYjGCqisJ5Hfm669wmw9jvCSe 4LXKjGjffnNAPSv1o11UBoiVVAG+G8nwHUf51hOwsPNUnHGIbiwF9q/d/TCmNT9ky1cB 8Gn21q/xFRlgWaZbxHeZ42tiPwwrh6/IdXLSard+MYLmSl92401Jcebz19EYmNP/E7OI g9N+p/fIx95sDyFcZOwd/mXNCj2/mRT8M37KlAY7SlbfYH58YgfzBPoAfqEpTsTFCZvP /XFSeOUi3YMjzXeKZn22j5isL6UczpNTZPUjyIYeEsGZN5BIw8uB9Olq5UA5n66I3jwf B4gw== X-Gm-Message-State: AOJu0Ywhpb4qaQKilRM6+1w6rfM+HKDYGwSnrY4UhHEd4lG3vDd0tfwz H15x7hOaYdkL8QrbfAFjumD+Eocgm0E9q6vdIugB/G+BdCvadc8NgJUnZWDoihKv5usuv/XXSdk g X-Received: by 2002:a05:6a20:2a24:b0:1be:c1c0:b8de with SMTP id adf61e73a8af0-1bec1c0ba08mr7864672637.42.1719602423611; Fri, 28 Jun 2024 12:20:23 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:e1e5:c76f:25c0:c643:3eb]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce16f9dsm2000008a91.8.2024.06.28.12.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 12:20:23 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Khem Raj Subject: [PATCH] debug: Fix clang open fortify wrapper (BZ 31927) Date: Fri, 28 Jun 2024 16:20:15 -0300 Message-ID: <20240628192018.137313-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 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 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 clang open fortify wrapper from 4228baef1a94e8bde84ad74 added a restriction where open with 3 arguments where flags do not contain O_CREAT or O_TMPFILE are handled as invalid. They are not invalid, since the third argument is ignored, and the gcc wrapper also allows it. Checked x86_64-linux-gnu and with a yocto build for some affected packages. Tested-by: “Khem Raj ” --- io/bits/fcntl2.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/io/bits/fcntl2.h b/io/bits/fcntl2.h index c8888b50c1..0cced392e7 100644 --- a/io/bits/fcntl2.h +++ b/io/bits/fcntl2.h @@ -61,13 +61,8 @@ open (const char *__path, int __oflag, ...) return __open_alias (__path, __oflag, __va_arg_pack ()); } #elif __fortify_use_clang -__fortify_function_error_function __attribute_overloadable__ int -open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag, ...) - __fortify_clang_unavailable ("open can be called either with 2 or 3 arguments, not more"); - __fortify_function __attribute_overloadable__ int open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag) - __fortify_clang_prefer_this_overload __fortify_clang_error (__OPEN_NEEDS_MODE (__oflag), "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments") {