Received: by 10.192.165.148 with SMTP id m20csp63823imm; Thu, 3 May 2018 14:59:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFLpGJlcWPKYfZbwoXw45i0BctJGwhNCfienVPIboTBSH0zxGGbn0e6boJ7bKVx/zJ+by3 X-Received: by 2002:a63:6185:: with SMTP id v127-v6mr20236066pgb.441.1525384786703; Thu, 03 May 2018 14:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525384786; cv=none; d=google.com; s=arc-20160816; b=TKt18K8h0ysKFNZ0Tni3hRPRfgZPBuOhgSizxU477hZQelA1tectBSnUuJfKC76cAF YonneNbjFdfHzGFz8KaiV5/Zo3EicQvN2FmPgmPW9DJ+PPnV9UJJmuRvF4AxZ8IPiMp4 EmmIVd/RUy0hle3c+hk0IvBBYBSM0qWp1xT9vv39xZoFHELegqsWdxehmeZ1RmL/lMg7 E7kJWB+mnSmtvkiH1YbODRFoSH90ud06q5rXLnv+aE90rYLL49P8rIZG1NM8O7+oh521 Ypw36SGJ9x9/P6xMRB4miU2G1QXdSPMOQ9/rTlHlScevks+sj2A0PIoVAMxcmstTts8I 6HKQ== 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=qD29v0Y3fQMZflX2AQxlqGjFq1s+VIhMrlCeHU2dxLs=; b=GHrNe9crnglHMisEBQ9Q+JxCtyrc1DHfkodRB5Q8RzJ/+xQpU+ohWTKJHV57wQ/6wE vHdRDSTckOfAtqb8BLs92x5RD+YBc+uma6OsS+YOXkDOsoHBlEdxJm9FpV+KmXj7/OTY ILYglf9hs1Rla6I7EOKnuxrBUd/fInhRvpPmt6MA5aCGeNt7JFxSn0f/2uE+1oTcbLax Y+xiMyq8lPROcV9voXdQje3X1LLJCTeb8MBve6uBTv61xTDny7a+hbOhkUxxE+s76TaL m4ZK8dtUDrvtmchi3EhVVqkBlnOJwNVrbzUEG7fL9juEpGPkqwDIjsi6HqHHxJn6Zb0q Da0A== 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 q124-v6si12081983pgq.215.2018.05.03.14.59.32; Thu, 03 May 2018 14:59:46 -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 S1751307AbeECV7H (ORCPT + 99 others); Thu, 3 May 2018 17:59:07 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:49392 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750911AbeECV7F (ORCPT ); Thu, 3 May 2018 17:59:05 -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 1fEMFk-0004Pp-IJ; Thu, 03 May 2018 15:59:04 -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 1fEMFj-00049U-Hg; Thu, 03 May 2018 15:59:04 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Matthew Garrett Cc: Mimi Zohar , David Howells , linux-integrity , LSM List , kexec@lists.infradead.org, Linux Kernel Mailing List References: <1523572911-16363-1-git-send-email-zohar@linux.vnet.ibm.com> <87r2mso5up.fsf@xmission.com> Date: Thu, 03 May 2018 16:58:56 -0500 In-Reply-To: (Matthew Garrett's message of "Thu, 03 May 2018 20:39:48 +0000") Message-ID: <876044l7tr.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=1fEMFj-00049U-Hg;;;mid=<876044l7tr.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+LOxRAoenxX49z7AISsDfqQqRn4pd+cnY= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa02.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,T_XMDrugObfuBody_08, XMNoVowels,XMSolicitRefs_0 autolearn=disabled version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 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 * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug * 0.0 T_TooManySym_01 4+ unique symbols in subject * 1.0 T_XMDrugObfuBody_08 obfuscated drug references X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Matthew Garrett X-Spam-Relay-Country: X-Spam-Timing: total 653 ms - load_scoreonly_sql: 0.08 (0.0%), signal_user_changed: 3.7 (0.6%), b_tie_ro: 2.6 (0.4%), parse: 1.64 (0.3%), extract_message_metadata: 28 (4.3%), get_uri_detail_list: 4.0 (0.6%), tests_pri_-1000: 11 (1.6%), tests_pri_-950: 2.2 (0.3%), tests_pri_-900: 1.78 (0.3%), tests_pri_-400: 38 (5.8%), check_bayes: 36 (5.4%), b_tokenize: 14 (2.1%), b_tok_get_all: 9 (1.4%), b_comp_prob: 6 (0.9%), b_tok_touch_all: 2.8 (0.4%), b_finish: 0.85 (0.1%), tests_pri_0: 553 (84.6%), check_dkim_signature: 1.14 (0.2%), check_dkim_adsp: 6 (0.9%), tests_pri_500: 9 (1.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/3] kexec: limit 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 Matthew Garrett writes: > On Thu, May 3, 2018 at 1:13 PM Eric W. Biederman > wrote: > >> Mimi Zohar writes: > >> > In environments that require the kexec kernel image to be signed, > prevent >> > using the kexec_load syscall. In order for LSMs and IMA to > differentiate >> > between kexec_load and kexec_file_load syscalls, this patch set adds a >> > call to security_kernel_read_file() in kexec_load_check(). > >> Having thought about it some more this justification for these changes >> does not work. The functionality of kexec_load is already root-only. >> So in environments that require the kernel image to be signed just don't >> use kexec_load. Possibly even compile kexec_load out to save space >> because you will never need it. You don't need a new security hook to >> do any of that. Userspace is a very fine mechanism for being the >> instrument of policy. > >> If you don't trust userspace that needs to be spelled out very clearly. >> You need to talk about what your threat models are. > > kexec_load gives root arbitrary power to modify the running kernel image, > including the ability to disable enforcement of module signatures. No. It does absolutely nothing to the running kernel image. Combined with reboot(..., LINUX_REBOOT_CMD_KEXE, ...) it does allow booting something different. It is argubably a little more efficient than writing to a file to direct the bootloader to boot something different and then calling reboot. But it is not fundamentally different. > Given > that it weakens other security mechanisms that are designed to prevent root > from disabling them, it makes sense to allow the imposition of an > equivalent restriction. Say what. You are saying a lot of words without any specifics. Not a specific threat mode. Not which security mecahnisms you are worried about weakening. Not what classes of problems you are trying to defend against. I absolutely hate this nonsense. I thought you already went 20 rounds with Linus and learned you need to be upfront with what you are concerned about. I believe reasonable situations can be constructed. But I am not seeing that happen here. My hand wavy argument to go with yours is that code paths that are root only are not audited for security properties. As such the number of exploitable bus you can find in them is larger than normal. It might be a little harder to mount xfs or another filesystem with an exploitable file system image but I expect it exists. Further nothing I have seen you involved with has been about truly hardening the system against a hostile root. I have for the last several years been chipping away at that and you have been nowhere to be found. So please be specific. Talk about which threat you are worried about. Because so far this looks like someones effort to look like they were doing something without actually caring about real world threats. Eric