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: 93036 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 423823826DDF for ; Fri, 28 Jun 2024 19:20:47 +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-Google-Smtp-Source: AGHT+IHX2RzUVRZPRK+9kPJ/4GhQpxhr4fyubea2iLTh6/EYFTSUgn/gL+BCvLoeCxA6v7qm1vp8nw== 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+patchwork=sourceware.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") {