From patchwork Sun May 28 17:20:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 70194 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 83D863855592 for ; Sun, 28 May 2023 17:20:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83D863855592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685294444; bh=4RGFA+w0npmx+Fg5s+zvUvyimrcgN/gn6b+lkYgU2Ik=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RbNxetc38RBYTwjp7DsttRqGWyE5f5WA4aZ4Ck4NE4DG3b1slxNTPUe9pglk01QXc HxNc+MdHV2qXtvbZ8myd6AVk8LZoFolRS3JiC0GWKh+x8bNfPTGUFVPmkKkF9Wdx/z i0eTAPQTZYK1tjFLiu6qNoN0p+iDUkUjdWUGtAr8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 2CDDB3858CDA for ; Sun, 28 May 2023 17:20:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CDDB3858CDA Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f4f3ac389eso1279223e87.1 for ; Sun, 28 May 2023 10:20:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685294416; x=1687886416; 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=4RGFA+w0npmx+Fg5s+zvUvyimrcgN/gn6b+lkYgU2Ik=; b=Fggss7D5AFHIMIrrZ49lB4WnPORlb4hv7svtPzG7jaUI2X/5FmRwBa/8oa/ZYf55qn nUS9G6s1xDy5EsnOJeX1obWCxszqg+ndwcAeb9sKRpjEvJgey7LvTRngE87UXicu5uJd I1R2aonSu2GBEpoHe0ayhXTQQdu9d4S8qUHPd/VyOKoGzt9PKWN/PDS3sEFRaXoCTckL 3CuIMUfyBPG3yZNrSTYjUH3QGfIKLwB8s5+YWhxB1nhZyK8DKYgZeI8JzafTAcR4jmdK aqfBmaUK2e6Hgg0qlZapQL0UKU6yvgTMjIwaPe6PhxL2Gc6JSP3NYO7ShiCMDqndcpp5 49SQ== X-Gm-Message-State: AC+VfDxWY+XV5p7ePohr7RG6HvCjgIfEBt8m0SSRLz1RJHjZyTbLtAcn R+rTWRwByV4md7rrY1KUpA98BPG6/xs= X-Google-Smtp-Source: ACHHUZ6cc7cSKFt4v7WVBVCpbf/9994kZRVJpd5IUc08pwbptNPW7at+crfDnKAzFdFjc2oWZZJ4XA== X-Received: by 2002:ac2:4465:0:b0:4f2:53f6:d4bf with SMTP id y5-20020ac24465000000b004f253f6d4bfmr2715866lfl.48.1685294416195; Sun, 28 May 2023 10:20:16 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:5e3d:a067:bc18:2967]) by smtp.gmail.com with ESMTPSA id v26-20020a19741a000000b004f4d5003e8dsm1662596lfe.7.2023.05.28.10.20.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 10:20:15 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 1/3] support: Add support_fcntl_support_ofd_locks () Date: Sun, 28 May 2023 20:20:11 +0300 Message-Id: <20230528172013.73111-2-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528172013.73111-1-bugaevc@gmail.com> References: <20230528172013.73111-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Signed-off-by: Sergey Bugaev Reviewed-by: Adhemerval Zanella --- support_xxx_support_yyy () seems to be the naming pattern for this kind of functions? support/Makefile | 1 + support/support.h | 3 ++ support/support_fcntl_support_ofd_locks.c | 44 +++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 support/support_fcntl_support_ofd_locks.c diff --git a/support/Makefile b/support/Makefile index 92f1a246..e9a00b2d 100644 --- a/support/Makefile +++ b/support/Makefile @@ -58,6 +58,7 @@ libsupport-routines = \ support_descriptors \ support_enter_mount_namespace \ support_enter_network_namespace \ + support_fcntl_support_ofd_locks \ support_format_address_family \ support_format_addrinfo \ support_format_dns_packet \ diff --git a/support/support.h b/support/support.h index b7f76bf0..e20d2ce7 100644 --- a/support/support.h +++ b/support/support.h @@ -178,6 +178,9 @@ static __inline bool support_itimer_support_time64 (void) #endif } +/* Return true if the kernel/file supports open file description locks. */ +extern bool support_fcntl_support_ofd_locks (int fd); + /* Return true if stat supports nanoseconds resolution. PATH is used for tests and its ctime may change. */ extern bool support_stat_nanoseconds (const char *path); diff --git a/support/support_fcntl_support_ofd_locks.c b/support/support_fcntl_support_ofd_locks.c new file mode 100644 index 00000000..fb197a70 --- /dev/null +++ b/support/support_fcntl_support_ofd_locks.c @@ -0,0 +1,44 @@ +/* Return whether the kernel/file supports OFD locks. + Copyright (C) 2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +bool +support_fcntl_support_ofd_locks (int fd) +{ +#ifdef F_OFD_GETLK + int res; + struct flock flock; + memset (&flock, 0, sizeof (flock)); + + flock.l_type = F_WRLCK; + flock.l_whence = SEEK_SET; + flock.l_start = 0; + flock.l_len = INT32_MAX; + flock.l_pid = 0; + + res = fcntl (fd, F_OFD_GETLK, &flock); + return res != -1 || errno != EINVAL; +#else + (void) fd; + return false; +#endif +} From patchwork Sun May 28 17:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 70195 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 1D6153856DD4 for ; Sun, 28 May 2023 17:20:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D6153856DD4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685294449; bh=HusZAiEp2p1vo5ZcgzUzBcrU53SPu3W6E+fWb708c7Y=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=AJXfDxu/Cw5YNZ8D1UHjSHTNUNmqW+E1GX7lr25Mzi8QM+hnZQJ1/7nTmqc2ubB87 w6cdeovLiEK4vHhjy+A2jvFf4fGFiyFMq+kC70T15NjPJA+HSC9MHcZlZqlYPBOhIy RF/4NvGGcZBhmG8aMK/MxxFTy6OlPu8/I2hda/4A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 228FC3858C74 for ; Sun, 28 May 2023 17:20:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 228FC3858C74 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f4f3ac389eso1279233e87.1 for ; Sun, 28 May 2023 10:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685294417; x=1687886417; 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=HusZAiEp2p1vo5ZcgzUzBcrU53SPu3W6E+fWb708c7Y=; b=b7Xbx6PY8n3OHnRCM7vjsi42CpXC72jeM9d34BAneZbNZ8x5W8y0lrIWk+BO4hMzWr IieoSDb0KgF2pTZLpXZKdxyCaG5Ols5Qx6UeSDH3eG0MTdlTDyjqXGlc40mfb/LYSkDa 42VtQM6Bim612k5HC0wya4EAXqfmGH+VN3KrK3Fc9y/RELA1WxCoNyr3m3kFWroEBI5S p06nADI1wZbOj/ELe/O6dKSN4A7gt+cMJp++afuw3ggLGFoohecs83E415i1P+R7+XKn /NYQXivebmWJLuWYwnLKz5JXOjwdO3ssHMtlHhYbOOSzTTuGf97aOLHS8L8S3k9UG6t9 uOQA== X-Gm-Message-State: AC+VfDy15eNIP9O3psg51ViOsIAbVlSC3I8pt0HOLyoTWpqyAQYcLxq/ sCnWF6/H0kWsEoGDrkP0Hwf38Xy5snM= X-Google-Smtp-Source: ACHHUZ7vZDSsylJzIhEdV5mEBDyMwHiRLVTep0Fq7ePKrEkaFNp2eBR55lmxFmP72bWWZyDAxLbCbg== X-Received: by 2002:ac2:5ec7:0:b0:4f3:822e:f025 with SMTP id d7-20020ac25ec7000000b004f3822ef025mr2667557lfq.49.1685294417207; Sun, 28 May 2023 10:20:17 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:5e3d:a067:bc18:2967]) by smtp.gmail.com with ESMTPSA id v26-20020a19741a000000b004f4d5003e8dsm1662596lfe.7.2023.05.28.10.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 10:20:16 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 2/3] cdefs.h: Define __glibc_warn_system_headers_{begin, end} Date: Sun, 28 May 2023 20:20:12 +0300 Message-Id: <20230528172013.73111-3-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528172013.73111-1-bugaevc@gmail.com> References: <20230528172013.73111-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" By default, GCC supresses warnings inside "system headers". Moreover, it also supresses warnings resulting from expansion of macros defined in system headers, even in the expansion itself happens in user code. This may be desirable most of the time because the user cannot do anything about the mistakes of the system headers, but sometimes causing a warning is an intentional effect that a macro has, in which case this GCC feature gets in a way. GCC allows turning off the warning suspension feature by passing -Wsystem-headers; however, that turns it off globally. But by using "#pragma GCC diagnostic" it can be made to only apply to the relevant macro definition, in which case GCC only does not supress warnings resulting from expansion of that one macro. To that end, introduce __glibc_warn_system_headers_begin and __glibc_warn_system_headers_end macros that can be used to surround a macro definition and ensure that warnings inside the macro are not supressed: __glibc_warn_system_headers_begin #define foo(x) bar_warn (x) __glibc_warn_system_headers_end This will be used in a following patch which turns fcntl and fcntl64 into macros that cause warnings on argument type mismatch. Note that "#pragma GCC diagnostic warning" normally overrides any diagnostic options specified on the command line, and so can even downgrade severity of a diagnostic from an error to a warning (if, for instance, -Werror is in effect). But this is not a concern here, since the actual warning that gets emitted is not "-Wsystem-headers", but some other specific warning; "-Wsystem-headers" is only used to disable its supression. So passing -Werror still causes the specific warning to be treated as an error, and to fail the compilation. Signed-off-by: Sergey Bugaev Reviewed-by: Adhemerval Zanella --- I'm not very sure about the prereq check. I stole it from the __glibc_macro_warning above (which also uses _Pragma), and according to the online docs GCC 4 has already supported -Wsystem-headers. misc/sys/cdefs.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 393d9091..d832d5c3 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -649,6 +649,21 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __glibc_macro_warning(msg) #endif +/* __glibc_warn_system_headers_begin starts a block of code where warnings + produced by expanding macros defined in system headers will *not* be + supressed. __glibc_warn_system_headers_end ends such a block. */ +#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) +# define __glibc_warn_system_headers1(message) _Pragma (#message) +# define __glibc_warn_system_headers_begin \ + __glibc_warn_system_headers1 (GCC diagnostic push) \ + __glibc_warn_system_headers1 (GCC diagnostic warning "-Wsystem-headers") +# define __glibc_warn_system_headers_end \ + __glibc_warn_system_headers1 (GCC diagnostic pop) +#else +# define __glibc_warn_system_headers_begin +# define __glibc_warn_system_headers_end +#endif + /* Generic selection (ISO C11) is a C-only feature, available in GCC since version 4.9. Previous versions do not provide generic selection, even though they might set __STDC_VERSION__ to 201112L, From patchwork Sun May 28 17:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 70196 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 794FF3858D38 for ; Sun, 28 May 2023 17:21:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 794FF3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685294493; bh=R888QZ63RKVyQkee5knhvHdmt00Ncx4LK0Tkr4fUDgw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tdvo9tVEJLatEWAsqa6kBhBddABspbi/SY916VV8lOZDUUZ4Zck/ospNLgCBhEcdt iYystrmnFCchSw1nUjkbN1IiozxBQ1WRE6E+TBFhHubVsRF6174SSfszsWs713kCa1 G2G8pY8rtjN/mNdWPeGZYnDqqmguuo2zFjZm2THI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id CA21F3858C31 for ; Sun, 28 May 2023 17:20:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA21F3858C31 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f3b39cea1eso2704291e87.3 for ; Sun, 28 May 2023 10:20:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685294419; x=1687886419; 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=R888QZ63RKVyQkee5knhvHdmt00Ncx4LK0Tkr4fUDgw=; b=Hsi64XXnyz/FfpLyEpQgXIlTDIWIE3pxLBV2U94WQf61LYJpXdTZ8pLklXC0BTfyyZ ZVlAAAd8KaF/jM7PeAoIFdqG/eoyfndrJJYH8XEEwQXIqHJOu4uzxgkyfF7Thp7SYnPN +z4EP7uknbfMxFu11tlcbb3KEG/Gyp6dk7076J/SRFq0eWdPcOYuIrT3unJRt1m5ChIf smIa01IRthypjtkP5gVsRnhgNlkGKaZofcanQlCPxjoB3wCgIOuR/wZXXF5zy8d+p/xB L0kY+DVqKUXl3Bns0fnOgYqdP9lpgXSe+DPIMeSQ7q4YTzU+HTQSBO+QJn9lAf+1GkfI F5Yw== X-Gm-Message-State: AC+VfDytrZvK9xA98dxocM8EiCHvUrbdd7CG/zPWzBomQqr86+/T4pxk dOMVuVwICRk1X2kbfYr1mIQvPe2n244= X-Google-Smtp-Source: ACHHUZ7cW2f7gFQGGsAzP0phB+I8K6mIv5sIUihDfICJgsZNaDlZC4eF9VQSws5ISM3iXSJj2/ypyA== X-Received: by 2002:ac2:5a1e:0:b0:4f3:845e:f9e with SMTP id q30-20020ac25a1e000000b004f3845e0f9emr3029815lfn.13.1685294418273; Sun, 28 May 2023 10:20:18 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:5e3d:a067:bc18:2967]) by smtp.gmail.com with ESMTPSA id v26-20020a19741a000000b004f4d5003e8dsm1662596lfe.7.2023.05.28.10.20.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 10:20:17 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 3/3] io: Add FORTIFY_SOURCE check for fcntl arguments Date: Sun, 28 May 2023 20:20:13 +0300 Message-Id: <20230528172013.73111-4-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528172013.73111-1-bugaevc@gmail.com> References: <20230528172013.73111-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Both open () and fcntl () are "overloaded" to accept either 2 or 3 arguments; whether the last argument is required (and, in case of fcntl, the type of the third argument) depends on the values of the previous arguments. Since C provides no native support for function overloading, this is implemented by making these functions vararg. Unfortunately, this means the compiler is unable to check the number of arguments and their types for correctness at compile time, and will not diagnose any mistakes. To help with this, when FORTIFY_SOURCE is enabled, the special fcntl2.h header replaces open () with a wrapper that checks the passed number of arguments, raising a compile-time or run-time error on mismatch. This commit adds similar handling for fcntl (). Recently, Hector Martin has identified an issue in libwebrtc where fcntl (fd, F_DUPFD_CLOEXEC) was invoked without a third argument [0]. With the patch, the bug would have been detected at compile time, assuming libwebrtc is built with FORTIFY_SOURCE. Hopefully this will help detecting similar bugs in existing software, and prevent more instances of similar bugs from being introduced in the future. [0]: https://social.treehouse.systems/@marcan/110355001391961285 Add tests for fcntl () and fcntl64 () calls still compiling and functioning correctly in various configurations, and mention the new fortification in the manual. The abilists have been modified with 'make update-abi-all'. Signed-off-by: Sergey Bugaev --- debug/tst-fortify.c | 148 +++++++ include/fcntl.h | 1 + io/Makefile | 1 + io/Versions | 3 + io/bits/fcntl2.h | 397 ++++++++++++++++++ io/fcntl_2.c | 33 ++ manual/maint.texi | 19 +- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/x86_64/libc.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arc/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../sysv/linux/loongarch/lp64/libc.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 1 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + sysdeps/unix/sysv/linux/or1k/libc.abilist | 1 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 43 files changed, 632 insertions(+), 6 deletions(-) create mode 100644 io/fcntl_2.c diff --git a/debug/tst-fortify.c b/debug/tst-fortify.c index 7850a4e5..03264154 100644 --- a/debug/tst-fortify.c +++ b/debug/tst-fortify.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #ifndef _GNU_SOURCE # define MEMPCPY memcpy @@ -78,6 +80,15 @@ do_prepare (void) } } +/* Return VALUE, but do it in a way that the compiler cannot + see that it's a compile-time constant. */ +static int __attribute_noinline__ +hide_constant (int value) +{ + volatile int v = value; + return v; +} + volatile int chk_fail_ok; volatile int ret; jmp_buf chk_fail_buf; @@ -1763,6 +1774,143 @@ do_test (void) ppoll (fds, l0 + 2, NULL, NULL); CHK_FAIL_END # endif +#endif + + /* Check that we can do basic fcntl operations, both ones that require + the third argument, and ones that do not. */ + res = fcntl (STDIN_FILENO, F_GETFD); + TEST_COMPARE (res, 0); + res = fcntl (STDIN_FILENO, F_SETFD, 0); + TEST_COMPARE (res, 0); + +#ifdef F_OFD_GETLK + /* Check for confusion between 32- and 64-bit versions of the fcntl + interface. */ + int lockfd1 = xopen (temp_filename, O_RDWR, 0); + int lockfd2 = xopen (temp_filename, O_RDWR, 0); + + struct flock flock; + int ofd_locks_supported = support_fcntl_support_ofd_locks (lockfd1); + + if (ofd_locks_supported) + { + memset (&flock, 0, sizeof (flock)); + flock.l_type = F_WRLCK; + flock.l_whence = SEEK_SET; + flock.l_start = 1234; + flock.l_len = 5678; + flock.l_pid = 0; + + res = fcntl (lockfd1, F_OFD_SETLK, &flock); + TEST_COMPARE (res, 0); + + memset (&flock, 0, sizeof (flock)); + flock.l_type = F_RDLCK; + flock.l_whence = SEEK_SET; + flock.l_start = 3542; + flock.l_len = 411; + flock.l_pid = 0; + + res = fcntl (lockfd2, F_OFD_GETLK, &flock); + TEST_COMPARE (res, 0); + /* Check that we get the expected values. */ + TEST_COMPARE (flock.l_type, F_WRLCK); + TEST_COMPARE (flock.l_whence, SEEK_SET); + TEST_COMPARE (flock.l_start, 1234); + TEST_COMPARE (flock.l_len, 5678); + TEST_COMPARE (flock.l_pid, -1); + } +#endif + + /* Check that we can do fcntl operations with CMD that is not constant + at compile time. */ + res = fcntl (STDIN_FILENO, hide_constant (F_GETFD)); + TEST_COMPARE (res, 0); + res = fcntl (STDIN_FILENO, hide_constant (F_SETFD), 0); + TEST_COMPARE (res, 0); + +#ifdef F_OFD_GETLK + if (ofd_locks_supported) + { + memset (&flock, 0, sizeof (flock)); + flock.l_type = F_RDLCK; + flock.l_whence = SEEK_SET; + flock.l_start = 3542; + flock.l_len = 411; + flock.l_pid = 0; + + res = fcntl (lockfd2, hide_constant (F_OFD_GETLK), &flock); + TEST_COMPARE (res, 0); + /* Check that we get the expected values. */ + TEST_COMPARE (flock.l_type, F_WRLCK); + TEST_COMPARE (flock.l_whence, SEEK_SET); + TEST_COMPARE (flock.l_start, 1234); + TEST_COMPARE (flock.l_len, 5678); + TEST_COMPARE (flock.l_pid, -1); + } +#endif + +#if __USE_FORTIFY_LEVEL >= 1 + CHK_FAIL_START + fcntl (STDIN_FILENO, hide_constant (F_SETFD)); + CHK_FAIL_END +#endif + +#if defined (__USE_LARGEFILE64) || defined (__USE_TIME_BITS64) + /* Also check fcntl64 (). */ + res = fcntl64 (STDIN_FILENO, F_GETFD); + TEST_COMPARE (res, 0); + res = fcntl64 (STDIN_FILENO, F_SETFD, 0); + TEST_COMPARE (res, 0); + res = fcntl64 (STDIN_FILENO, hide_constant (F_GETFD)); + TEST_COMPARE (res, 0); + res = fcntl64 (STDIN_FILENO, hide_constant (F_SETFD), 0); + TEST_COMPARE (res, 0); + +#ifdef F_OFD_GETLK + if (ofd_locks_supported) + { + struct flock64 flock64; + + memset (&flock64, 0, sizeof (flock64)); + flock64.l_type = F_RDLCK; + flock64.l_whence = SEEK_SET; + flock64.l_start = 3542; + flock64.l_len = 411; + flock64.l_pid = 0; + + res = fcntl64 (lockfd2, F_OFD_GETLK, &flock64); + TEST_COMPARE (res, 0); + /* Check that we get the expected values. */ + TEST_COMPARE (flock64.l_type, F_WRLCK); + TEST_COMPARE (flock64.l_whence, SEEK_SET); + TEST_COMPARE (flock64.l_start, 1234); + TEST_COMPARE (flock64.l_len, 5678); + TEST_COMPARE (flock64.l_pid, -1); + + memset (&flock64, 0, sizeof (flock64)); + flock64.l_type = F_RDLCK; + flock64.l_whence = SEEK_SET; + flock64.l_start = 3542; + flock64.l_len = 411; + flock64.l_pid = 0; + + res = fcntl64 (lockfd2, hide_constant (F_OFD_GETLK), &flock64); + TEST_COMPARE (res, 0); + /* Check that we get the expected values. */ + TEST_COMPARE (flock64.l_type, F_WRLCK); + TEST_COMPARE (flock64.l_whence, SEEK_SET); + TEST_COMPARE (flock64.l_start, 1234); + TEST_COMPARE (flock64.l_len, 5678); + TEST_COMPARE (flock64.l_pid, -1); + } +#endif + +# if __USE_FORTIFY_LEVEL >= 1 + CHK_FAIL_START + fcntl64 (STDIN_FILENO, hide_constant (F_SETFD)); + CHK_FAIL_END +# endif #endif return ret; diff --git a/include/fcntl.h b/include/fcntl.h index be435047..cb86c5e7 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -32,6 +32,7 @@ extern int __open64_2 (const char *__path, int __oflag); extern int __openat_2 (int __fd, const char *__path, int __oflag); extern int __openat64_2 (int __fd, const char *__path, int __oflag); +extern int __fcntl_2 (int __fd, int __cmd); #if IS_IN (rtld) # include diff --git a/io/Makefile b/io/Makefile index 6b58728e..1773a0f2 100644 --- a/io/Makefile +++ b/io/Makefile @@ -71,6 +71,7 @@ routines := \ fchownat \ fcntl \ fcntl64 \ + fcntl_2 \ file_change_detection \ flock \ fstat \ diff --git a/io/Versions b/io/Versions index 4e195408..0e77a287 100644 --- a/io/Versions +++ b/io/Versions @@ -140,6 +140,9 @@ libc { GLIBC_2.34 { closefrom; } + GLIBC_2.38 { + __fcntl_2; + } GLIBC_PRIVATE { __libc_fcntl64; __fcntl_nocancel; diff --git a/io/bits/fcntl2.h b/io/bits/fcntl2.h index bdb48fa8..e8dd3dea 100644 --- a/io/bits/fcntl2.h +++ b/io/bits/fcntl2.h @@ -170,3 +170,400 @@ openat64 (int __fd, const char *__path, int __oflag, ...) } # endif #endif + +extern int __fcntl_2 (int __fd, int __cmd); + +#ifndef __USE_TIME_BITS64 + +# ifndef __USE_FILE_OFFSET64 +extern int __REDIRECT (__fcntl_alias, (int __fd, int __cmd, ...), fcntl); +extern int __REDIRECT (__fcntl_warn, (int __fd, int __cmd, ...), fcntl) + __warnattr ("fcntl argument has wrong type for this command"); +# else +extern int __REDIRECT (__fcntl_alias, (int __fd, int __cmd, ...), fcntl64); +extern int __REDIRECT (__fcntl_warn, (int __fd, int __cmd, ...), fcntl64) + __warnattr ("fcntl argument has wrong type for this command"); +# endif /* __USE_FILE_OFFSET64 */ + +# ifdef __USE_LARGEFILE64 +extern int __REDIRECT (__fcntl64_alias, (int __fd, int __cmd, ...), fcntl64); +extern int __REDIRECT (__fcntl64_warn, (int __fd, int __cmd, ...), fcntl64) + __warnattr ("fcntl64 argument has wrong type for this command"); +# endif + +#else /* __USE_TIME_BITS64 */ + +extern int __REDIRECT_NTH (__fcntl_alias, (int __fd, int __cmd, ...), + __fcntl_time64); +extern int __REDIRECT_NTH (__fcntl64_alias, (int __fd, int __cmd, ...), + __fcntl_time64); +extern int __REDIRECT (__fcntl_warn, (int __fd, int __cmd, ...), + __fcntl_time64) + __warnattr ("fcntl argument has wrong type for this command"); +extern int __REDIRECT (__fcntl64_warn, (int __fd, int __cmd, ...), + __fcntl_time64) + __warnattr ("fcntl64 argument has wrong type for this command"); + +#endif /* __USE_TIME_BITS64 */ + + +/* Whether the fcntl CMD is known to require an argument. */ +__extern_always_inline int +__fcntl_requires_arg (int __cmd) +{ + switch (__cmd) + { + case F_DUPFD: + case F_DUPFD_CLOEXEC: + case F_SETFD: + case F_SETFL: +#ifdef F_SETLK + case F_SETLK: + case F_SETLKW: + case F_GETLK: +#endif +#ifdef F_OFD_SETLK + case F_OFD_SETLK: + case F_OFD_SETLKW: + case F_OFD_GETLK: +#endif +#ifdef F_SETOWN + case F_SETOWN: +#endif +#ifdef F_GETOWN_EX + case F_GETOWN_EX: + case F_SETOWN_EX: + case F_SETSIG: +#endif +#ifdef F_SETLEASE + case F_SETLEASE: + case F_NOTIFY: + case F_SETPIPE_SZ: + case F_ADD_SEALS: + case F_GET_RW_HINT: + case F_SET_RW_HINT: + case F_GET_FILE_RW_HINT: + case F_SET_FILE_RW_HINT: +#endif + return 1; + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires an int argument. */ +__extern_always_inline int +__fcntl_is_int (int __cmd) +{ + switch (__cmd) + { + case F_DUPFD: + case F_DUPFD_CLOEXEC: + case F_SETFD: + case F_SETFL: +#ifdef F_SETOWN + case F_SETOWN: +#endif +#ifdef F_SETSIG + case F_SETSIG: +#endif +#ifdef F_SETLEASE + case F_SETLEASE: + case F_NOTIFY: + case F_SETPIPE_SZ: + case F_ADD_SEALS: +#endif + return 1; + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (const uint64_t *) argument. */ +__extern_always_inline int +__fcntl_is_const_uint64_t_ptr (int __cmd) +{ + switch (__cmd) + { +#ifdef F_SET_RW_HINT + case F_SET_RW_HINT: + case F_SET_FILE_RW_HINT: + return 1; +#endif + + default: + return 0; + } +} + + +/* Whether the fcntl CMD requires an (uint64_t *) argument. */ +__extern_always_inline int +__fcntl_is_uint64_t_ptr (int __cmd) +{ + switch (__cmd) + { +#ifdef F_GET_RW_HINT + case F_GET_RW_HINT: + case F_GET_FILE_RW_HINT: + return 1; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (const struct f_owner_ex *) argument. */ +__extern_always_inline int +__fcntl_is_const_fowner_ex (int __cmd) +{ + switch (__cmd) + { +#ifdef F_SETOWN_EX + case F_SETOWN_EX: + return 1; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (struct f_owner_ex *) argument. */ +__extern_always_inline int +__fcntl_is_fowner_ex (int __cmd) +{ + switch (__cmd) + { +#ifdef F_GETOWN_EX + case F_GETOWN_EX: + return 1; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (const struct flock *) argument. */ +__extern_always_inline int +__fcntl_is_const_flock (int __cmd, int __is_fcntl64) +{ + (void) __is_fcntl64; + switch (__cmd) + { +#ifdef F_SETLK + case F_SETLK: + case F_SETLKW: + return 1; +#endif + +#ifdef F_OFD_SETLK + case F_OFD_SETLK: + case F_OFD_SETLKW: + return !__is_fcntl64; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (struct flock *) argument. */ +__extern_always_inline int +__fcntl_is_flock (int __cmd, int __is_fcntl64) +{ + (void) __is_fcntl64; + switch (__cmd) + { +#ifdef F_GETLK + case F_GETLK: + return 1; +#endif + +#ifdef F_OFD_GETLK + case F_OFD_GETLK: + return !__is_fcntl64; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (const struct flock64 *) argument. */ +__extern_always_inline int +__fcntl_is_const_flock64 (int __cmd, int __is_fcntl64) +{ + (void) __is_fcntl64; + switch (__cmd) + { +#ifdef F_SETLK64 + case F_SETLK64: + case F_SETLKW64: + return 1; +#endif + +#ifdef F_OFD_SETLK + case F_OFD_SETLK: + case F_OFD_SETLKW: + return __is_fcntl64; +#endif + + default: + return 0; + } +} + +/* Whether the fcntl CMD requires a (struct flock64 *) argument. */ +__extern_always_inline int +__fcntl_is_flock64 (int __cmd, int __is_fcntl64) +{ + (void) __is_fcntl64; + switch (__cmd) + { +#ifdef F_GETLK64 + case F_GETLK64: + return 1; +#endif + +#ifdef F_OFD_GETLK + case F_OFD_GETLK: + return __is_fcntl64; +#endif + + default: + return 0; + } +} + +#ifndef __cplusplus + +# define __fcntl_types_compatible(arg, type) \ + __builtin_types_compatible_p (__typeof (arg), type) + +#else + +template +struct __fcntl_types_compatible_helper +{ + __always_inline static int + __compatible () + { + return 0; + } +}; + +template +struct __fcntl_types_compatible_helper<__T, __T> +{ + __always_inline static int + __compatible () + { + return 1; + } +}; + +# define __fcntl_types_compatible(arg, type) \ + __fcntl_types_compatible_helper<__typeof (arg), type>::__compatible () + +#endif /* __cplusplus */ + +#define __fcntl_type_check_int(arg) __fcntl_types_compatible (arg, int) + +#define __fcntl_type_check_const_uint64_t_ptr(arg) \ + (__fcntl_types_compatible (arg, const __uint64_t *) \ + || __fcntl_types_compatible (arg, __uint64_t *)) + +#define __fcntl_type_check_uint64_t_ptr(arg) \ + __fcntl_types_compatible (arg, __uint64_t *) + +#define __fcntl_type_check_const_fowner_ex(arg) \ + (__fcntl_types_compatible (arg, const struct f_owner_ex *) \ + || __fcntl_types_compatible (arg, struct f_owner_ex *)) + +#define __fcntl_type_check_fowner_ex(arg) \ + __fcntl_types_compatible (arg, struct f_owner_ex *) + +#define __fcntl_type_check_const_flock(arg) \ + (__fcntl_types_compatible (arg, const struct flock *) \ + || __fcntl_types_compatible (arg, struct flock *)) + +#define __fcntl_type_check_flock(arg) \ + __fcntl_types_compatible (arg, struct flock *) + +#ifdef __USE_LARGEFILE64 + +# define __fcntl_type_check_const_flock64(arg) \ + (__fcntl_types_compatible (arg, const struct flock64 *) \ + || __fcntl_types_compatible (arg, struct flock64 *)) + +# define __fcntl_type_check_flock64(arg) \ + __fcntl_types_compatible (arg, struct flock64 *) + +#else + +# define __fcntl_type_check_const_flock64(arg) 0 +# define __fcntl_type_check_flock64(arg) 0 + +#endif /* __USE_LARGEFILE64 */ + +#define __fcntl_type_check(cmd, arg, is_fcntl64) \ + (__fcntl_is_int (cmd) ? __fcntl_type_check_int (arg) : \ + __fcntl_is_const_uint64_t_ptr (cmd) \ + ? __fcntl_type_check_const_uint64_t_ptr (arg) : \ + __fcntl_is_uint64_t_ptr (cmd) ? __fcntl_type_check_uint64_t_ptr (arg) : \ + __fcntl_is_const_fowner_ex (cmd) \ + ? __fcntl_type_check_const_fowner_ex (arg) : \ + __fcntl_is_fowner_ex (cmd) ? __fcntl_type_check_fowner_ex (arg) : \ + __fcntl_is_const_flock (cmd, is_fcntl64) \ + ? __fcntl_type_check_const_flock (arg) : \ + __fcntl_is_flock (cmd, is_fcntl64) ? __fcntl_type_check_flock (arg) : \ + __fcntl_is_const_flock64 (cmd, is_fcntl64) \ + ? __fcntl_type_check_const_flock64 (arg) : \ + __fcntl_is_flock64 (cmd, is_fcntl64) ? __fcntl_type_check_flock64 (arg) : \ + 1) + + +__errordecl (__fcntl_missing_arg, + "fcntl with with this command needs 3 arguments"); + +__fortify_function int +__fcntl_2_inline (int __fd, int __cmd) +{ + if (!__builtin_constant_p (__cmd)) + return __fcntl_2 (__fd, __cmd); + + if (__fcntl_requires_arg (__cmd)) + __fcntl_missing_arg (); + + return __fcntl_alias (__fd, __cmd); +} + +__glibc_warn_system_headers_begin + +#define fcntl(fd, cmd, ...) \ + (__VA_OPT__ (0 ?) __fcntl_2_inline (fd, cmd) \ + __VA_OPT__ (: \ + !__builtin_constant_p (cmd) ? __fcntl_alias (fd, cmd, __VA_ARGS__) \ + : __fcntl_type_check (cmd, __VA_ARGS__, 0) \ + ? __fcntl_alias (fd, cmd, __VA_ARGS__) \ + : __fcntl_warn (fd, cmd, __VA_ARGS__))) + +#ifdef __USE_LARGEFILE64 + +#define fcntl64(fd, cmd, ...) \ + (__VA_OPT__ (0 ?) __fcntl_2_inline (fd, cmd) \ + __VA_OPT__ (: \ + !__builtin_constant_p (cmd) ? __fcntl64_alias (fd, cmd, __VA_ARGS__) \ + : __fcntl_type_check (cmd, __VA_ARGS__, 1) \ + ? __fcntl64_alias (fd, cmd, __VA_ARGS__) \ + : __fcntl64_warn (fd, cmd, __VA_ARGS__))) + + +#endif + +__glibc_warn_system_headers_end diff --git a/io/fcntl_2.c b/io/fcntl_2.c new file mode 100644 index 00000000..8db79c2a --- /dev/null +++ b/io/fcntl_2.c @@ -0,0 +1,33 @@ +/* _FORTIFY_SOURCE wrapper for fcntl. + Copyright (C) 2013-2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Make sure to get __fcntl_requires_arg from bits/fcntl2.h */ +#undef _FORTIFY_SOURCE +#define _FORTIFY_SOURCE 1 + +#include +#include + +int +__fcntl_2 (int fd, int cmd) +{ + if (__fcntl_requires_arg (cmd)) + __fortify_fail ("invalid fcntl call: this command requires an argument"); + + return __libc_fcntl64 (fd, cmd); +} diff --git a/manual/maint.texi b/manual/maint.texi index a8441e20..74647e40 100644 --- a/manual/maint.texi +++ b/manual/maint.texi @@ -200,7 +200,7 @@ functions but may also include checks for validity of other inputs to the functions. When the @code{_FORTIFY_SOURCE} macro is defined, it enables code that -validates inputs passed to some functions in @theglibc to determine if +validates inputs passed to some functions in @theglibc{} to determine if they are safe. If the compiler is unable to determine that the inputs to the function call are safe, the call may be replaced by a call to its hardened variant that does additional safety checks at runtime. Some @@ -221,7 +221,8 @@ returned by the @code{__builtin_object_size} compiler builtin function. If the function returns @code{(size_t) -1}, the function call is left untouched. Additionally, this level also enables validation of flags to the @code{open}, @code{open64}, @code{openat} and @code{openat64} -functions. +functions, as well as validation of the presence and the type of the +third argument to the @code{fcntl} and @code{fcntl64} functions. @item @math{2}: This behaves like @math{1}, with the addition of some checks that may trap code that is conforming but unsafe, e.g. accepting @@ -243,10 +244,11 @@ depending on the architecture, one may also see fortified variants have the @code{_chkieee128} suffix or the @code{__nldbl___} prefix to their names. -Another exception is the @code{open} family of functions, where their -fortified replacements have the @code{__} prefix and a @code{_2} suffix. -The @code{FD_SET}, @code{FD_CLR} and @code{FD_ISSET} macros use the -@code{__fdelt_chk} function on fortification. +Another exception is the @code{open} and @code{fcntl} families of +functions, where their fortified 2-argument version replacements have the +@code{__} prefix and a @code{_2} suffix. The @code{FD_SET}, @code{FD_CLR} +and @code{FD_ISSET} macros use the @code{__fdelt_chk} function on +fortification. The following functions and macros are fortified in @theglibc{}: @c Generated using the following command: @@ -255,6 +257,7 @@ The following functions and macros are fortified in @theglibc{}: @c sort -u | grep ^__ | @c grep -v -e ieee128 -e __nldbl -e align_cpy -e "fdelt_warn" | @c sed 's/__fdelt_chk/@item @code{FD_SET}\n\n@item @code{FD_CLR}\n\n@item @code{FD_ISSET}\n/' | +@c sed 's/__fcntl_2/@item @code{fcntl}\n\n@item @code{fcntl64}\n/' | @c sed 's/__\(.*\)_\(chk\|2\)/@item @code{\1}\n/' @itemize @bullet @@ -267,6 +270,10 @@ The following functions and macros are fortified in @theglibc{}: @item @code{explicit_bzero} +@item @code{fcntl} + +@item @code{fcntl64} + @item @code{FD_SET} @item @code{FD_CLR} diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 6925222f..5397289b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2294,6 +2294,7 @@ GLIBC_2.36 arc4random_buf F GLIBC_2.36 arc4random_uniform F GLIBC_2.36 c8rtomb F GLIBC_2.36 mbrtoc8 F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index a0be5c1a..6ed14d1f 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -194,6 +194,7 @@ GLIBC_2.38 __errno_location F GLIBC_2.38 __explicit_bzero_chk F GLIBC_2.38 __fbufsize F GLIBC_2.38 __fcntl F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __fdelt_chk F GLIBC_2.38 __fdelt_warn F GLIBC_2.38 __fentry__ F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 0e2d9c30..6a3e3e7c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2633,6 +2633,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index f1bec197..4cbc9346 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2730,6 +2730,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index aa874b88..01fa7a34 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2394,6 +2394,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index afbd57da..2d7f5db4 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -514,6 +514,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index e7364cd3..85eea0e5 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -511,6 +511,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 913fa592..0bc57ae1 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2670,6 +2670,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 43af3a98..4f2e8b5d 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2619,6 +2619,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index af72f8fa..8b8b8789 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2803,6 +2803,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 48cbb0fa..22f7f159 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2568,6 +2568,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist index c15884bb..acb9a793 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist @@ -2154,6 +2154,7 @@ GLIBC_2.36 wprintf F GLIBC_2.36 write F GLIBC_2.36 writev F GLIBC_2.36 wscanf F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 3738db81..af6762d1 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -515,6 +515,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index ed136277..19ac2156 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2746,6 +2746,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 83577386..6d7e9d95 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2719,6 +2719,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 58c5da58..08459ff7 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2716,6 +2716,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index d3741945..3b9caff0 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2711,6 +2711,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 5319fdc2..2eb10c81 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2709,6 +2709,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 1743ea6e..7f13cd56 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2717,6 +2717,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 9b1f53c6..adea92bf 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2619,6 +2619,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index ae1c6ca1..2816e0b3 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2758,6 +2758,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist index a7c572c9..93674747 100644 --- a/sysdeps/unix/sysv/linux/or1k/libc.abilist +++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist @@ -2140,6 +2140,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 074fa031..68aa8601 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2773,6 +2773,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index dfcb4bd2..bc2f2b8d 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2806,6 +2806,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 63bbccf3..cdc982a3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2527,6 +2527,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index ab85fd61..66733662 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2829,6 +2829,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fscanfieee128 F GLIBC_2.38 __isoc23_fwscanf F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index b716f5c7..6cf51998 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2396,6 +2396,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 774e777b..84f920f2 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2596,6 +2596,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 8625135c..c80822de 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2771,6 +2771,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index d00c7eb2..ac344828 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2564,6 +2564,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index b6303724..c064e000 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2626,6 +2626,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index d8005561..a185e3cb 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2623,6 +2623,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 5be55c11..ad5aa083 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2766,6 +2766,7 @@ GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F GLIBC_2.37 __ppoll64_chk F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 475fdaae..27fffe9d 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2591,6 +2591,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 6cfb928b..3c46f003 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2542,6 +2542,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index c7350971..5a4fa94c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2648,6 +2648,7 @@ GLIBC_2.36 pidfd_open F GLIBC_2.36 pidfd_send_signal F GLIBC_2.36 process_madvise F GLIBC_2.36 process_mrelease F +GLIBC_2.38 __fcntl_2 F GLIBC_2.38 __isoc23_fscanf F GLIBC_2.38 __isoc23_fwscanf F GLIBC_2.38 __isoc23_scanf F