Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1263380oof; Tue, 25 Sep 2018 10:18:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV63i0e2/RSKce3K+c2s/JcPZrjQTPD/024AIX05JABrx0IvHwVF5UFrZ6hysdqJsa8/4fSWs X-Received: by 2002:a63:334c:: with SMTP id z73-v6mr1948437pgz.220.1537895913808; Tue, 25 Sep 2018 10:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537895913; cv=none; d=google.com; s=arc-20160816; b=mst08OmpoSASzbqvNkxEYoLlrv+NhbkK2/AK7VUkHtT4keaaUbW/g5qSD8wh5MfUGb WVs1wuPWg1sNJqM9G65jvkytbBCtlFHI2l7/D2Ud4i/jDYKJvfRS5SD1qY7AfmID1/wo 1k5m+/PjXuKs4XpoYqbh2E5c0VgAAU/WshWLM+3roUnD7NuoghuQ2VkW1gb/1d613kGr JDXegtxGWxSqGdn4R2w9YSnEw+C8L2GeLMHPdUYkYu2bNPFiWr6hLLZrJPwcZrHnC4g5 ru0c/bWtarMKdtOu0dfCfY/Zcz6e73hG3Den2Fl+9wRG3qTkl+jYlE69RpDt566skxRw VUWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:date:cc:to:from; bh=rpn/t0W/rCOA1jjpVV7a7fTU//VGavHHhw2DmFOpXPk=; b=S9RR9qtmkvIgPe8DYrOxk7/F6B5WoECL8uNRkir01zKjCeHFhsDNWCWgzJ2yN4IW0G ALkiym4oRM/PBs202pspNa5oh/m9qw9BMFfsYtrJYMHTD4HN4HcaKKFZ3EYH1627WeM1 zfKUJf56Jj5Lh5V+OcJOhX/oWs39roDSpC3sTrrduvU3DR6roSDi4l6s3l2/RBsOzHT7 p93wM5rZ065S2sVcpoGBW8fpa6AISFPlyEOPVdJhA6pV2Zd0b7yJL/ir50ch7cXoAGpK 9CfSJ9m4PETyKtFz7WQ0laI1HEcR/tpqJpWFjXxCcRMF9dYXbueL9N3XmpidFWVyyqzy 5Pcw== 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 s33-v6si2849587pga.302.2018.09.25.10.17.48; Tue, 25 Sep 2018 10:18:33 -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 S1727613AbeIYXZv (ORCPT + 99 others); Tue, 25 Sep 2018 19:25:51 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:43916 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbeIYXZu (ORCPT ); Tue, 25 Sep 2018 19:25:50 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4qxe-0004kk-2C; Tue, 25 Sep 2018 11:17:22 -0600 Received: from [105.184.227.67] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4qxN-0001Oy-Fx; Tue, 25 Sep 2018 11:17:21 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Cc: , , Oleg Nesterov , Linus Torvalds Date: Tue, 25 Sep 2018 19:16:51 +0200 Message-ID: <87h8idv6nw.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1g4qxN-0001Oy-Fx;;;mid=<87h8idv6nw.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=105.184.227.67;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/wm5RZQcxt2WGN+93xR6NRyXihVwnfvCs= X-SA-Exim-Connect-IP: 105.184.227.67 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TooManySym_01,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 0.7 XMSubLong Long Subject * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4990] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***; X-Spam-Relay-Country: X-Spam-Timing: total 15043 ms - load_scoreonly_sql: 0.15 (0.0%), signal_user_changed: 5 (0.0%), b_tie_ro: 3.1 (0.0%), parse: 1.97 (0.0%), extract_message_metadata: 8 (0.1%), get_uri_detail_list: 2.9 (0.0%), tests_pri_-1000: 7 (0.0%), compile_eval: 43 (0.3%), tests_pri_-950: 2.8 (0.0%), tests_pri_-900: 2.7 (0.0%), tests_pri_-400: 29 (0.2%), check_bayes: 27 (0.2%), b_tokenize: 11 (0.1%), b_tok_get_all: 7 (0.0%), b_comp_prob: 2.4 (0.0%), b_tok_touch_all: 3.6 (0.0%), b_finish: 0.92 (0.0%), tests_pri_0: 322 (2.1%), check_dkim_signature: 1.42 (0.0%), check_dkim_adsp: 7 (0.0%), tests_pri_500: 14644 (97.3%), poll_dns_idle: 14631 (97.3%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 0/6] signal: Shrinking the kernel's siginfo structure X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am posting these patches for review in the hopes that if I have missed something someone else might catch it. If no issues turn up I intend to merge these patches through my siginfo branch. This set of patches make a few small ABI changes to areas of the linux ABI where as far as I can determine no one cares. - sigqueueinfo in all it's variants now fails if si_signo != sig instead of quietly changing si_signo. The deep issue is that the change happens after the code has already verified in copy_siginfom_from_user that the si_signo and si_code combination is meaningful. - copy_siginfo_from_user now fails if the trailing bytes of siginfo are not 0, when the signal number and si_code combination is not recognized. If the si_signo and si_code combination is recognized we know any trailing bytes are meaningless as the meaningful bytes are in siginfo. This check is to allow people to define new siginfo union members and that will fail on older kernels. The check makes it as safe as possible to have a kernel_siginfo that is smaller than the ABI defined siginfo that the kernel reads from and writes to userspace. The net effect of this change is a kernel that only uses 48 bytes for siginfo internally when the ABI defines siginfo to be 128 bytes. The first EMT_TAGOVF change is not necesssary to strinking siginfo. Eric W. Biederman (6): signal/sparc: Move EMT_TAGOVF into the generic siginfo.h signal: Fail sigqueueinfo if si_signo != sig signal: Remove the need for __ARCH_SI_PREABLE_SIZE and SI_PAD_SIZE signal: Introduce copy_siginfo_from_user and use it's return value signal: Distinguish between kernel_siginfo and siginfo signal: Use a smaller struct siginfo in the kernel arch/alpha/include/uapi/asm/siginfo.h | 1 - arch/arm64/include/uapi/asm/Kbuild | 1 + arch/arm64/include/uapi/asm/siginfo.h | 24 --- arch/ia64/include/uapi/asm/siginfo.h | 2 - arch/mips/include/uapi/asm/siginfo.h | 11 -- arch/parisc/include/uapi/asm/Kbuild | 1 + arch/parisc/include/uapi/asm/siginfo.h | 11 -- arch/powerpc/include/uapi/asm/Kbuild | 1 + arch/powerpc/include/uapi/asm/siginfo.h | 18 --- arch/riscv/include/uapi/asm/Kbuild | 1 + arch/riscv/include/uapi/asm/siginfo.h | 24 --- arch/s390/include/uapi/asm/Kbuild | 1 + arch/s390/include/uapi/asm/siginfo.h | 17 --- arch/sparc/include/uapi/asm/siginfo.h | 7 - arch/x86/include/asm/compat.h | 2 +- arch/x86/include/uapi/asm/siginfo.h | 2 - drivers/usb/core/devio.c | 4 +- fs/binfmt_elf.c | 6 +- fs/coredump.c | 2 +- fs/fcntl.c | 2 +- fs/signalfd.c | 6 +- include/linux/binfmts.h | 2 +- include/linux/compat.h | 4 +- include/linux/coredump.h | 4 +- include/linux/lsm_hooks.h | 4 +- include/linux/posix-timers.h | 2 +- include/linux/ptrace.h | 2 +- include/linux/sched.h | 2 +- include/linux/sched/signal.h | 18 +-- include/linux/security.h | 6 +- include/linux/signal.h | 16 +- include/linux/signal_types.h | 8 +- include/trace/events/signal.h | 4 +- include/uapi/asm-generic/siginfo.h | 193 ++++++++++++----------- ipc/mqueue.c | 2 +- kernel/ptrace.c | 22 ++- kernel/seccomp.c | 6 +- kernel/signal.c | 263 ++++++++++++++++++++++---------- kernel/time/posix-timers.c | 2 +- security/apparmor/lsm.c | 2 +- security/security.c | 2 +- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- 43 files changed, 356 insertions(+), 356 deletions(-) Eric