From patchwork Fri Jan 8 00:49:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sebor X-Patchwork-Id: 41674 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 A77F43971C08; Fri, 8 Jan 2021 00:49:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A77F43971C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610066951; bh=C4XKaJRxFwGQIV6yxfndN+YQNGkkfqRoVniCLRnoSQo=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Pmsr8rOxwlgZoXD0zcuupHCL/jZjsfVw2y84PIMeOONwHq32rCIy4YUXbzm648YfW X/ELN3NE/GJT48A6plTY/qcTYOSaqtNvTaK1+KApeKWhzsg+eJH6dwXJhTRZGK0mpk ymSITwAYJpuyq/gS/VqRZ9LPGBNPCAfLEnW7EZ6A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 471193971836 for ; Fri, 8 Jan 2021 00:49:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 471193971836 Received: by mail-il1-x12d.google.com with SMTP id q1so8641224ilt.6 for ; Thu, 07 Jan 2021 16:49:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=C4XKaJRxFwGQIV6yxfndN+YQNGkkfqRoVniCLRnoSQo=; b=M81QVr7NZvP1h5mQBKhO8gf2prfSUdkusQdBQi1gPDSfe6GKixpHB+m/L7XrufFeAN f0pAEKh3hW2z4Olrj4F+hU4cx1oDplMOmg0AEt8/BMg8T5vJGgRg6lm2vDiH2A6nTm2/ EAKy93g2S0R8jzxBuCZTuRDOyk0xi1bG8FQFQIlXU8qdY24A+QKqfiv7TS9riSCMmITg ywz9aeXtLuvoXDqSAw4eU7FOefq2b5wzDCeJ9FFkMNhBbtja4o6rIUScrGrwzPtoPAn4 MzFOxBbdE1WCNYiEK0g/SKN8hIbJ/m5aBWPTgWfFOq6tbmwVQ4Ct6SNFeYKRqU3hHqhH tYUQ== X-Gm-Message-State: AOAM530sEaF36IqHgxGigL2SiWx/Xb6y4jhLJQg4qFNB3GmKNhWrH/VO d6sr51VoMY4yBuXj9SswCU+uMEI75kc= X-Google-Smtp-Source: ABdhPJyOEm8SWRCMBRIfBAIR/yiRH+9OqAwptoXE2KuYey16gDB3rfLYqQXy5zK9UwiYe3CsO7TGxA== X-Received: by 2002:a92:418d:: with SMTP id o135mr1520881ila.213.1610066949670; Thu, 07 Jan 2021 16:49:09 -0800 (PST) Received: from [192.168.0.41] (75-166-96-128.hlrn.qwest.net. [75.166.96.128]) by smtp.gmail.com with ESMTPSA id t21sm6000134ild.86.2021.01.07.16.49.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 16:49:07 -0800 (PST) Subject: [PATCH] correct readlinkat attribute access (BZ #27024) To: GNU C Library Message-ID: Date: Thu, 7 Jan 2021 17:49:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-10.3 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 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Martin Sebor via Libc-alpha From: Martin Sebor Reply-To: Martin Sebor Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The mode in the new attribute access added in g:06febd8c670 to readlinkat() for the third argument is wrong: it's read_only but the function writes into the object. The mode should be write_only. The trivial patch below corrects this mistake. Unless there are objections I'll go ahead and commit it in the next few days. Martin /* Remove the link NAME. */ diff --git a/posix/unistd.h b/posix/unistd.h index 1306aded46..3f22763379 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -831,7 +831,7 @@ extern int symlinkat (const char *__from, int __tofd, /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4)); + __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); #endif