Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2949564imm; Thu, 24 May 2018 19:43:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpwDKIadoruT8PS3GCmaNdbbeAFufk9bjDrB11jeumqMLvac8PnBQlXvOKNAUdbeDsc/310 X-Received: by 2002:aa7:819a:: with SMTP id g26-v6mr600825pfi.210.1527216187046; Thu, 24 May 2018 19:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216187; cv=none; d=google.com; s=arc-20160816; b=B0SvkSMe3KbTmfOArmnZwa8tkVRh/whk6K8umEHenjQk0Qc8yqQ00pnZhOZ/RZ9fvs 1hmBhUrKTgGc8d3IhB/l/loEitgND3Ogce3EanbRtrGnFLTLUSbIoFhiGxz2zAdAqsKf riUQLlPPhpTBm5YJUKMaHnr40OkJ9Gep/vWpo8bD3zq4ehE7/THPiPSKpI+L4QBYevom JZQiZubdYFStoamYdPdthfp+4zTMrVgBQnErfTzpQLTi1T105B9AmaLjrG66mZ3TPsl4 gpZ/FT6m7PrirbHVHkaTRXm0EwdETM8ZNBqWSGwhNklOkaQ076q0C31iUX/GXrQLZCWj H+Nw== 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:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=dBMH/hplB5UOgG97yjvrlQl4iIOqxHeOMfH2GqyCTiY=; b=A/KW+iAWrAsJscFv8Za0BhNPAOhQIC/MOZMBcJ/uU/DxHpgvlLfo77mUvhcK8OGSQ8 Cdg6MicTN0SbVzKoz2TPKbPxU05iar9EwdzVYPtENy8kYl1Lc/v5FRPhavDq28N03rmR ouue4m7Oz+F3joyHN+FC1nwA+6ieIWF5+uiYHbTGo8SrDvMLFmSP5PaFVdwwoqHtX+WG yaIVD0RTsKXMwfCd3Li9CD8UlUDsdRk+VCgcGKLXuQUFuKHZo4ENhfqpu7rPdJ9Tyw79 u8UoxlWIBntlSCI5DD/Pk+ZdOzIb3zM++3MnEApw7cEhMANogbjDSHIiW6jmm20acKwV JSnA== 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 p4-v6si3378019plk.600.2018.05.24.19.42.52; Thu, 24 May 2018 19:43:07 -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 S969451AbeEXUuQ (ORCPT + 99 others); Thu, 24 May 2018 16:50:16 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:35175 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966499AbeEXUuO (ORCPT ); Thu, 24 May 2018 16:50:14 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fLxBd-00019Q-Mb; Thu, 24 May 2018 14:50:13 -0600 Received: from [97.119.174.25] (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 1fLxBc-00054m-B0; Thu, 24 May 2018 14:50:13 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Mimi Zohar Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , "Luis R . Rodriguez" , kexec@lists.infradead.org, Andres Rodriguez , Greg Kroah-Hartman , Ard Biesheuvel , Kees Cook References: <1527160176-29269-1-git-send-email-zohar@linux.vnet.ibm.com> <1527160176-29269-3-git-send-email-zohar@linux.vnet.ibm.com> Date: Thu, 24 May 2018 15:50:03 -0500 In-Reply-To: <1527160176-29269-3-git-send-email-zohar@linux.vnet.ibm.com> (Mimi Zohar's message of "Thu, 24 May 2018 07:09:31 -0400") Message-ID: <87k1rs22ys.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=1fLxBc-00054m-B0;;;mid=<87k1rs22ys.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18H+yMl6ib3PjPYrgfcPi9KxUpmnZGcqyI= X-SA-Exim-Connect-IP: 97.119.174.25 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=1.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,T_XMDrugObfuBody_08, XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -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 * 1.0 T_XMDrugObfuBody_08 obfuscated drug references X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Mimi Zohar X-Spam-Relay-Country: X-Spam-Timing: total 1046 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 2.3 (0.2%), b_tie_ro: 1.54 (0.1%), parse: 1.17 (0.1%), extract_message_metadata: 16 (1.5%), get_uri_detail_list: 2.5 (0.2%), tests_pri_-1000: 10 (1.0%), tests_pri_-950: 1.28 (0.1%), tests_pri_-900: 1.03 (0.1%), tests_pri_-400: 27 (2.6%), check_bayes: 26 (2.5%), b_tokenize: 10 (0.9%), b_tok_get_all: 7 (0.7%), b_comp_prob: 3.4 (0.3%), b_tok_touch_all: 3.3 (0.3%), b_finish: 0.65 (0.1%), tests_pri_0: 177 (17.0%), check_dkim_signature: 0.68 (0.1%), check_dkim_adsp: 2.8 (0.3%), tests_pri_500: 807 (77.1%), poll_dns_idle: 802 (76.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v3 2/7] kexec: add call to LSM hook in original kexec_load syscall 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 Mimi Zohar writes: > In order for LSMs and IMA-appraisal to differentiate between the > original and new syscalls, both the original and new syscalls must call > an LSM hook. This patch adds a call to security_kernel_read_data() in > the original kexec syscall. Until the lsm hook mess gets cleaned up. Nacked-by: "Eric W. Biederman" > > Signed-off-by: Mimi Zohar > Cc: Eric Biederman > Cc: Luis R. Rodriguez > Cc: Kees Cook > Cc: David Howells > --- > kernel/kexec.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/kernel/kexec.c b/kernel/kexec.c > index aed8fb2564b3..061ada41c18c 100644 > --- a/kernel/kexec.c > +++ b/kernel/kexec.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -195,10 +196,17 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments, > static inline int kexec_load_check(unsigned long nr_segments, > unsigned long flags) > { > + int result; > + > /* We only trust the superuser with rebooting the system. */ > if (!capable(CAP_SYS_BOOT) || kexec_load_disabled) > return -EPERM; > > + /* Permit LSMs and IMA to fail the kexec */ > + result = security_kernel_read_data(NULL, READING_KEXEC_IMAGE); > + if (result < 0) > + return result; > + > /* > * Verify we have a legal set of flags > * This leaves us room for future extensions.