From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B3F8C43381 for ; Fri, 15 Mar 2019 21:20:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4E6D218AC for ; Fri, 15 Mar 2019 21:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726446AbfCOVUL (ORCPT ); Fri, 15 Mar 2019 17:20:11 -0400 Received: from albireo.enyo.de ([5.158.152.32]:58866 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfCOVUL (ORCPT ); Fri, 15 Mar 2019 17:20:11 -0400 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1h4uFI-0001AG-95; Fri, 15 Mar 2019 21:20:04 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.89) (envelope-from ) id 1h4uFI-0001RH-2d; Fri, 15 Mar 2019 22:20:04 +0100 From: Florian Weimer To: Arnd Bergmann Cc: "David S . Miller" , Deepa Dinamani , Willem de Bruijn , alpha , linux-arch , linux-mips@vger.kernel.org, Parisc List , sparclinux , Laura Abbott , Networking , Linux Kernel Mailing List , Linux API Subject: Re: [PATCH] y2038: fix socket.h header inclusion References: <20190311153857.563743-1-arnd@arndb.de> <87k1h1fgkk.fsf@mid.deneb.enyo.de> Date: Fri, 15 Mar 2019 22:20:04 +0100 In-Reply-To: (Arnd Bergmann's message of "Fri, 15 Mar 2019 21:30:25 +0100") Message-ID: <87a7hvded7.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org * Arnd Bergmann: > On Thu, Mar 14, 2019 at 7:41 PM Florian Weimer wrote: >> >> * Arnd Bergmann: >> >> > diff --git a/arch/alpha/include/uapi/asm/socket.h >> > b/arch/alpha/include/uapi/asm/socket.h >> > index 0d0fddb7e738..976e89b116e5 100644 >> > --- a/arch/alpha/include/uapi/asm/socket.h >> > +++ b/arch/alpha/include/uapi/asm/socket.h >> > @@ -2,8 +2,8 @@ >> > #ifndef _UAPI_ASM_SOCKET_H >> > #define _UAPI_ASM_SOCKET_H >> > >> > +#include >> > #include >> > -#include >> >> This breaks POSIX conformance in glibc because the >> header is not namespace clean. It contains the >> identifiers fds_bits and val: >> >> unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))]; >> >> int val[2]; > > What is problematic about the struct members here? I had thought that > only the struct names have to be in a namespace to be usable here, > but not the members. According POSIX, a user can do this: #define fds_bits 1024 before including the header file. Similarly for val. Since glibc pulls in indirectly, the result is a parse error, even though the programmer did nothing wrong (fds_bits is not an identifier used by POSIX, nor is it in the implementation namespace, ans is a POSIX header). > We could use asm/posix_types.h instead of linux/posix_types.h, > would that address your concern? It should fix the fds_bits case, I think. But still uses val, so that part of the issue remains. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Date: Fri, 15 Mar 2019 21:20:04 +0000 Subject: Re: [PATCH] y2038: fix socket.h header inclusion Message-Id: <87a7hvded7.fsf@mid.deneb.enyo.de> List-Id: References: <20190311153857.563743-1-arnd@arndb.de> <87k1h1fgkk.fsf@mid.deneb.enyo.de> In-Reply-To: (Arnd Bergmann's message of "Fri, 15 Mar 2019 21:30:25 +0100") MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Arnd Bergmann Cc: "David S . Miller" , Deepa Dinamani , Willem de Bruijn , alpha , linux-arch , linux-mips@vger.kernel.org, Parisc List , sparclinux , Laura Abbott , Networking , Linux Kernel Mailing List , Linux API * Arnd Bergmann: > On Thu, Mar 14, 2019 at 7:41 PM Florian Weimer wrote: >> >> * Arnd Bergmann: >> >> > diff --git a/arch/alpha/include/uapi/asm/socket.h >> > b/arch/alpha/include/uapi/asm/socket.h >> > index 0d0fddb7e738..976e89b116e5 100644 >> > --- a/arch/alpha/include/uapi/asm/socket.h >> > +++ b/arch/alpha/include/uapi/asm/socket.h >> > @@ -2,8 +2,8 @@ >> > #ifndef _UAPI_ASM_SOCKET_H >> > #define _UAPI_ASM_SOCKET_H >> > >> > +#include >> > #include >> > -#include >> >> This breaks POSIX conformance in glibc because the >> header is not namespace clean. It contains the >> identifiers fds_bits and val: >> >> unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))]; >> >> int val[2]; > > What is problematic about the struct members here? I had thought that > only the struct names have to be in a namespace to be usable here, > but not the members. According POSIX, a user can do this: #define fds_bits 1024 before including the header file. Similarly for val. Since glibc pulls in indirectly, the result is a parse error, even though the programmer did nothing wrong (fds_bits is not an identifier used by POSIX, nor is it in the implementation namespace, ans is a POSIX header). > We could use asm/posix_types.h instead of linux/posix_types.h, > would that address your concern? It should fix the fds_bits case, I think. But still uses val, so that part of the issue remains.