Received: by 10.192.165.148 with SMTP id m20csp2071imm; Thu, 3 May 2018 13:41:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZodmKuvW3/lNY7/c8t2wLopKrT/xNEZOIm/wEmEF58FQxWPbfDtYRcwRbcY2WRcDeglo1kJ X-Received: by 2002:a17:902:7288:: with SMTP id d8-v6mr7467666pll.218.1525380109029; Thu, 03 May 2018 13:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525380108; cv=none; d=google.com; s=arc-20160816; b=Bn3orIdo3U9fqdIeSQdzidQWZxGr4GW1zfZvfF1l6yNFYEAxpgRc40x2+j7WHp2dIy vLs4lNfiNCYCHzr/pu4oTWJPxtDpIHZ+9Ccp/u2VvP/pz5hiJ8HGdj1SXZjgSzTWlWB9 d7StWp3Wmdzf5fHGsaxV3jvsyYojxrFChSCTiqn7+Lgrityw4fmyAirdpfzlrDo8tcs5 ZxhyicjtSTjpWm3IDM56bq6FL5o6wWzDRi5E9MzmtpvXuYXxDoRRoNC68ChRVi0pM4Z/ bwRG6iV1BHyrURYXg17dBbRTW/9jWcZZV2sePlwQOG4YKkIpToneQ79j+BNM1FO2LKbZ Nu9Q== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Z0vqinZsypBYmLEXPmxQ+Br9tAvliApwUwbaJhmYK8U=; b=AjGAvZOnZtE9r5ZKA8ZMCZalO8lKfqDnLeVj/6hpeHgAG5GpYG7853hbMV0gljphXf cUtURwF3rdhYJBNpR4/oKgS7voa4vnZhRpoYurn0CIYHfVjQIhqekYNi5gdJv8v/HVFK Aq4lkNegBxjZ1cKwjqCpSLFpT86u5nuHz9ogh4PEBSuhf4RQ6H7KrdRBk0nk4epIi4/m 7O8cJYWetKevMO/FxpopU2FXQH6GVWVSDdpzrPPfoWWXljjX5E+t8EnIu7YJ6X8T1jDx ukJduDv3H6GbQbh9ymL8CJEHocFwbWNDGlluK/zhJp/aQFUK/Ia33Lawl457A5wviC7v MayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eEgs+OxU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23-v6si8674562pgc.515.2018.05.03.13.41.30; Thu, 03 May 2018 13:41:48 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=eEgs+OxU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbeECUkB (ORCPT + 99 others); Thu, 3 May 2018 16:40:01 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:53525 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbeECUj7 (ORCPT ); Thu, 3 May 2018 16:39:59 -0400 Received: by mail-it0-f67.google.com with SMTP id f65-v6so858073itd.3 for ; Thu, 03 May 2018 13:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z0vqinZsypBYmLEXPmxQ+Br9tAvliApwUwbaJhmYK8U=; b=eEgs+OxU8J7K2bSUdVrr38afFDno9dbhdmn1dvZcXwUBNpPw5OMgWlgwUxGf6Essnt FbopQbPxk6d/hkLtkLlS+2ObzDL9GRIFMwcVBj/ZMxf7r/Z3uGT9h9HuZQ2DnSiMmqQB m6e+zv1gmDoT0p2/tmPQ8jzqZ6hJoJxoUYng3l8kH3eXRvw7BEouDrq1+4HAa5kwn9eB nx2ryNrvFzgR7Y5eGlUxeuCQsgAJAPgM8sxXKacKycAxRaBDpQsO3DSoeOYVHqdbI7uQ dEXbvstuScIW4kd58A6cCDFIYqFba3zQ6roj/K+tGvhTesmyE0jx7iPUR8saDlXcrSYk jIOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z0vqinZsypBYmLEXPmxQ+Br9tAvliApwUwbaJhmYK8U=; b=emg1IXzusy+1r7ym72QbMMv9nEpLW6AGF7lHS84iQVhxZIaKnmiQGLVmNVnxu/hOk0 jQtoEZMQQ2m6jKcb02ZANmgLI+kGI1nCOiCmbrfvlcjCdp3UH+qFAxKzknfxJUqsXI+M V9tvS4UOukLZBOUyunVzSiJ5UR/ql+K6hjMlLMIwDeS7j8hi5QOf0Uw4VGZTScgIB/QX TEaf1Nl1PFG+doHHFWdO9NBP4pgp8+HN0kskmMF7gI0Taf4GNxunQ/fUgIoqvxpnLMqD uJy+mMuk7zp+nTBYGcF/tjHuvbNkoFFB/pSOvB3im8p7zzcLwvt9zPpMyZ66PWXmCqxI karQ== X-Gm-Message-State: ALQs6tBSrYBqoLdKd9F5XlvnmQ5TB9wty4hlIxIRQoj7Ap/jWqjWip6O TcRQKrWkEkRiokuo0sPo5oAX96lX1H15vgAs9mL7tQ== X-Received: by 2002:a24:4089:: with SMTP id n131-v6mr24281355ita.8.1525379998794; Thu, 03 May 2018 13:39:58 -0700 (PDT) MIME-Version: 1.0 References: <1523572911-16363-1-git-send-email-zohar@linux.vnet.ibm.com> <87r2mso5up.fsf@xmission.com> In-Reply-To: <87r2mso5up.fsf@xmission.com> From: Matthew Garrett Date: Thu, 03 May 2018 20:39:48 +0000 Message-ID: Subject: Re: [PATCH 0/3] kexec: limit kexec_load syscall To: ebiederm@xmission.com Cc: Mimi Zohar , David Howells , linux-integrity , LSM List , kexec@lists.infradead.org, Linux Kernel Mailing List 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, 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. 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.