Received: by 10.192.165.156 with SMTP id m28csp865036imm; Thu, 19 Apr 2018 08:48:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zrmOth/+bhV8+Oyls43tUur/bQpxlaHghU3TwnaJPPvdVo9ZTMPN7fNkgd+enWW+X6nht X-Received: by 10.99.125.74 with SMTP id m10mr5557178pgn.80.1524152899127; Thu, 19 Apr 2018 08:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524152899; cv=none; d=google.com; s=arc-20160816; b=CWItTNx0Y61KwftF70RxKtBLEG7sa0bQqm+NqMH7AGcO/JYl14dHZsAZQE+xtiyQBg SR/sglk2noQipBsPHqEj48hqFctSY+TkGcr0pGYvdPSqIICEGtv+vuRz7KJwcO3IUvKZ 08HvW13u/cSc/yTbDFzWQsG+cEQTYhEy4IBVthd1P1HPCa1nM6kGAthvV+Z/zW1Pr08V +hLg7VCqIV/bhcmv8HJMxg6AeJHMmujR/LlqLftwMfodLr2q+REkLsp0ioNjiAG8KUyC 5jfF7b+n+A2Qr/6hbSjWuJLzRACeHkMt1teBDV18oweW3OnRryeN/ELOmPa3JlBk0Nzv fEdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=1URVK+ZjsRNJ0X+MGnYOGTj0VLPc4aKPpNIRYvq624k=; b=R0k9W1jHlZAXsWjVGytW9xLSEuwdTOe4NcE2dh8SfR9Fh8fCinPjN8ICzN3HmjdQPK Pcma+X7locHKHO7BOkyawmsqMkBp79xpdCV8jWrpVVfWvF+21bqAoIXdW+OxskymA12m CbB/csjGvIk4s9nZtQR/oXSGQ4oG05ZW10echaHFkZJWS+1uR5XEOyUgDbHtw6/VNef+ l0dLrjKVCYc+2vWpCGkBrgb4t51/EgrelbdMs7eAJ4+rcyeMIZQ5/HxgPqYIW669Ws5R kkbMDtvdeaRHS8Jk/2DHzTJ9XCbt9i3XsXp6QzCvHD6rpdO+Y+k5/ob0fZlqIhX19KQz dlJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si1658298pgc.262.2018.04.19.08.48.03; Thu, 19 Apr 2018 08:48:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbeDSPqh (ORCPT + 99 others); Thu, 19 Apr 2018 11:46:37 -0400 Received: from l2mail1.panix.com ([166.84.1.75]:57190 "EHLO l2mail1.panix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752679AbeDSPqf (ORCPT ); Thu, 19 Apr 2018 11:46:35 -0400 X-Greylist: delayed 958 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Apr 2018 11:46:35 EDT Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by l2mail1.panix.com (Postfix) with ESMTPS id C49A27E97; Thu, 19 Apr 2018 11:30:37 -0400 (EDT) Received: from mail-ot0-f182.google.com (mail-ot0-f182.google.com [74.125.82.182]) by mailbackend.panix.com (Postfix) with ESMTPSA id 74A4F1FCE1; Thu, 19 Apr 2018 11:30:35 -0400 (EDT) Received: by mail-ot0-f182.google.com with SMTP id p33-v6so6263095otp.11; Thu, 19 Apr 2018 08:30:35 -0700 (PDT) X-Gm-Message-State: ALQs6tA27+DyFA+w/DV/sq3dXXR5AoOCO8GVwTNc8l2+KjeF4USYpYI7 YFzE/0Ks7kJCqPO+1Nutt3oLYLkcr0pAcpogHag= X-Received: by 2002:a9d:4ee:: with SMTP id 101-v6mr3972796otm.122.1524151835157; Thu, 19 Apr 2018 08:30:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:588a:0:0:0:0:0 with HTTP; Thu, 19 Apr 2018 08:30:34 -0700 (PDT) In-Reply-To: <20180419143737.606138-2-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> <20180419143737.606138-2-arnd@arndb.de> From: Zack Weinberg Date: Thu, 19 Apr 2018 11:30:34 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 01/17] y2038: asm-generic: Extend sysvipc data structures To: Arnd Bergmann Cc: y2038@lists.linaro.org, Linux Kernel Mailing List , linux-api@vger.kernel.org, GNU C Library , Martin Schwidefsky Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 10:37 AM, Arnd Bergmann wrote: > Most architectures now use the asm-generic copy of the sysvipc data > structures (msqid64_ds, semid64_ds, shmid64_ds), which use 32-bit > __kernel_time_t on 32-bit architectures but have padding behind them to > allow extending the type to 64-bit. > > Unfortunately, that fails on all big-endian architectures, which have the > padding on the wrong side. As so many of them get it wrong, we decided to > not bother even trying to fix it up when we introduced the asm-generic > copy. Instead we always use the padding word now to provide the upper > 32 bits of the seconds value, regardless of the endianess. > > A libc implementation on a typical big-endian system can deal with > this by providing its own copy of the structure definition to user > space, and swapping the two 32-bit words before returning from the > semctl/shmctl/msgctl system calls. This seems generally like a sound approach, but I need to ask whether any of the structures involved can ever appear in a sendmsg() control message (that is, in the data pointed to by msg_control), or an AF_NETLINK message, or any other situation where the kernel communicates a structured message of arbitrary size to user space or vice versa. libc can't munge those messages, because new message types can be added faster than libc can keep up with them, and because I/O primitives like sendmsg() generally aren't allowed to allocate arbitrarily-large scratch buffers. zw