Received: by 10.213.65.68 with SMTP id h4csp527646imn; Sat, 31 Mar 2018 03:58:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49aevBXpATMuSeBVC8S/hN5v/lE6dElASdQIsgAnDduj/CN+yd42eMbS+5+M6kagb8BC144 X-Received: by 2002:a17:902:1c1:: with SMTP id b59-v6mr2577204plb.325.1522493905664; Sat, 31 Mar 2018 03:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522493905; cv=none; d=google.com; s=arc-20160816; b=DtE4izLwtS9zwtLiVvzgNRwuWRJw/D1N/6/2pWzc/sjOhj9e09WRJipJ+NSkB09lbR V/XWWqNWfE8mTl2Ls38cTOv4wltOKLv0r/ZxjoBLjEiZZJFriII9mUuhnVbnf453VlUM e+fb32kA81kz/KC47Swaz0kOW1AdUb2mJozu8ysmR+E184LSLwZP32x/5M0szDAvQlwW cqJovn3dRBNfzgnRkHH1DErzP3MlC/g5hXoXD1aqfppdRjHZCvNh8cNGA28tL1WfHrfr mw07w2RFRPbklEKU+KU+W8iX68LbKSBTLnn91w4oNp3cfK3+6TMsUv/Bk8DKnI1xOw9a n+qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=b0R4WrofP+GtMtp3dUZxdzIGiKstt7VbgwvIeaDb+jk=; b=Tr6SocLJvm8IgT2THvOoOvkTodQuQNhc0E0GIW2AaYZ6B3y3HxTdv4Lx4brB2yi+lp kwlqIdAwusS9+8/vnFfy0HkMsKqePSdqPQM75zyewwccV0+usYXzwtEWXx55WE+iTLlZ SOAhHwaVoJi5s7g5ty47qqgG1hBM8YAO5XC3RLThTRZK3hX42W8RB7nX/IVVdxwjAa3d hRhvZNoLai88rE0bNOqBfTpQUKjsFrCcudJxQy/15O7SR+s5tvIr+6g/vdBAtEmYe/Pm qSoYk9cbVADjl7d89KUL1/oGvbhIvphF8ePknxtCU6rC1aJaNPuL/If3PglA63ZFFJBR 85XQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d128si7762622pfc.83.2018.03.31.03.57.58; Sat, 31 Mar 2018 03:58:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbeCaK4J (ORCPT + 99 others); Sat, 31 Mar 2018 06:56:09 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751520AbeCaK4I (ORCPT ); Sat, 31 Mar 2018 06:56:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6171E8182D0C; Sat, 31 Mar 2018 10:56:07 +0000 (UTC) Received: from asgard.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CFE22026DFD; Sat, 31 Mar 2018 10:56:05 +0000 (UTC) Date: Sat, 31 Mar 2018 12:56:58 +0200 From: Eugene Syromiatnikov To: "Eric W. Biederman" Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-m68k@vger.kernel.org Subject: Re: [GIT PULL] siginfo fix for v4.16-rc5 Message-ID: <20180331105658.GA4332@asgard.redhat.com> References: <87woypy8zc.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87woypy8zc.fsf@xmission.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 31 Mar 2018 10:56:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 31 Mar 2018 10:56:07 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'esyr@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 06, 2018 at 01:11:03AM -0600, Eric W. Biederman wrote: > Linus, > > Please pull the siginfo-linus branch from the git tree: > > git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git siginfo-linus > > HEAD: f6a015498dcaee72f80283cb7873d88deb07129c signal/x86: Include the field offsets in the build time checks > > The kbuild test robot found that I accidentally moved si_pkey when I was > cleaning up siginfo_t. A short followed by an int with the int having 8 > byte alignment. Sheesh siginfo_t is a weird structure. > > I have now corrected it and added build time checks that with a little > luck will catch any similar future mistakes. The build time checks were > sufficient for me to verify the bug and to verify my fix. So they are > at least useful this once. > > Eric W. Biederman (2): > signal: Correct the offset of si_pkey in struct siginfo Looks like this commit changes layout of the siginfo struct on m68k: pts/0, esyr@fedora: /tmp % cat si.c #include #include "linux/signal.h" static const size_t lower_offset = offsetof(struct siginfo, si_lower); pts/0, esyr@fedora: /tmp % m68k-linux-gnu-gcc -Ikhdr-v4.16-rc1\~159\^2\~20/include -g -c si.c -o si-orig.o pts/0, esyr@fedora: /tmp % m68k-linux-gnu-gcc -Ikhdr-v4.16-rc3\~17\^2/include -g -c si.c -o si-1.o pts/0, esyr@fedora: /tmp % m68k-linux-gnu-gcc -Ikhdr-v4.16-rc7-194-g29d9d38/include -g -c si.c -o si-2.o pts/0, esyr@fedora: /tmp % for i in si-orig.o si-1.o si-2.o; do echo -------- $i; objdump -t -j .rodata $i; objdump -s -j .rodata $i; done -------- si-orig.o si-orig.o: file format elf32-big SYMBOL TABLE: 00000000 l d .rodata 00000000 .rodata 00000000 l O .rodata 00000004 lower_offset si-orig.o: file format elf32-big Contents of section .rodata: 0000 00000012 .... -------- si-1.o si-1.o: file format elf32-big SYMBOL TABLE: 00000000 l d .rodata 00000000 .rodata 00000000 l O .rodata 00000004 lower_offset si-1.o: file format elf32-big Contents of section .rodata: 0000 00000012 .... -------- si-2.o si-2.o: file format elf32-big SYMBOL TABLE: 00000000 l d .rodata 00000000 .rodata 00000000 l O .rodata 00000004 lower_offset si-2.o: file format elf32-big Contents of section .rodata: 0000 00000014 .... So, the offset of the si_lower field is 20 at the current HEAD and was 18 at commits v4.16-rc3~17^2 and v4.16-rc1~159^2~20. I believe this is due to the fact that m68k uses 2-byte default alignment and not 4-byte. > signal/x86: Include the field offsets in the build time checks > > arch/x86/kernel/signal_compat.c | 65 ++++++++++++++++++++++++++++++++++++++ > include/linux/compat.h | 4 +-- > include/uapi/asm-generic/siginfo.h | 4 +-- > 3 files changed, 69 insertions(+), 4 deletions(-) >