From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12532 invoked from network); 26 Feb 2021 17:36:38 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 26 Feb 2021 17:36:38 -0000 Received: (qmail 27702 invoked by uid 550); 26 Feb 2021 17:36:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 27672 invoked from network); 26 Feb 2021 17:36:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:mime-version :content-transfer-encoding:content-language; bh=+DbUfmakxSyhHcd9okp3M6Jofl7/XwMeFkDYzJ7gGPg=; b=tf1JMvNTUwUlyQ9202mmJnoD25gnhJrKmkLa1fErf4/3P8cllL5Texhw6AWHeoHyQg L1qeC3PQ+PSCZf/ZUSWrI2wsD3ouvwK9uDA3y45QFKoBgGRoeHzd//wgOr89cSgeN7gp cv6vpxLh4hSzdOT7FNb7cA6bw04ifs8KJrtsA9wN2NDuAEWrp4TeNM63HUNQCb0XwcHd LoQIRswwMCNGOUvu9iDL9PcWhKG34hvK1X4w2cEagQN2UxtgGSOWEYVsEcCejU8YUHct yT19NmDgHh6Hx1k0RWbDDhxCgCtmi9MxZcdRNmKl0tjs8WR6Ictojz1mxBcZvNsYTiTR 0SCQ== 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:mime-version :content-transfer-encoding:content-language; bh=+DbUfmakxSyhHcd9okp3M6Jofl7/XwMeFkDYzJ7gGPg=; b=BQAhXfUr583Bw6B7/UOHRmseRmdiUnThJKTo5xMtA7mYp99jlZ4xJgypQMLQhNuEN8 9miUV6VB3iDR2UYPyD/7nxrt9GWf7k3E/pSMS1Aj8x7hhhsdZXmvyAlBd1CJYiFPsp4C +8RD8j/tp6tHUnKYNNvCGqsEqKqA6GsHTten10b8m9ApNHkcyEkd/PfOMWfjMQVP99Ju CwnOxV94NTU7u0365gRnqG2rvQDZw6UPXuHCxm4sCl/WC73zbEnK5Ge7JlI7XaffiTrJ KrVHm25muJLR8nLZbXBm1xHn+7nOOtYdiQtTTWxhHgLkL6eahi3BISLittDE90MKHpf/ wQLg== X-Gm-Message-State: AOAM5318ZGG+1C5G/JCvrGReaz/niHYEBVtCl7kkY3dsQysQUjRnZdUL G72YIvRY2+gIDpveY2AYxeTn4mpqD+g= X-Google-Smtp-Source: ABdhPJzFTkw55lRv1p4qge05dt+eFZB5KpnxcDLCg19SaSLrf1GHSoLQm+0EAJouS3lCopfIG2Lmmw== X-Received: by 2002:a05:620a:15bb:: with SMTP id f27mr3571313qkk.425.1614360979111; Fri, 26 Feb 2021 09:36:19 -0800 (PST) From: Dominic Chen To: musl@lists.openwall.com Message-ID: <77f18b20-f3fc-7b07-42e8-8fa013e52ec9@gmail.com> Date: Fri, 26 Feb 2021 12:36:19 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: [musl] fdopen() doesn't check for valid fd I've been verifying the behavior of an application between glibc and musl, and have noticed that the musl implementation of fdopen() assumes that the input fd is valid, whereas glibc does not. Per https://pubs.opengroup.org/onlinepubs/9699919799/, it seems that fdopen() is allowed to fail with EBADF, so inside __fdopen(), the syscalls to SYS_fcntl and SYS_ioctl should probably check for an error, deallocate the FILE *, and return nullptr. Thanks, Dominic