From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 17 13:24:26 2015 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30F8C676 for ; Fri, 17 Apr 2015 13:24:26 +0000 (UTC) Received: from trypticon.cs.illinois.edu (trypticon.cs.illinois.edu [128.174.237.181]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAAB0FC0 for ; Fri, 17 Apr 2015 13:24:25 +0000 (UTC) Received: from trypticon.cs.illinois.edu (localhost [127.0.0.1]) by trypticon.cs.illinois.edu (8.14.4/8.14.4/Debian-2.1ubuntu2) with ESMTP id t3HDONlc002039; Fri, 17 Apr 2015 08:24:23 -0500 Received: (from dautenh1@localhost) by trypticon.cs.illinois.edu (8.14.4/8.14.4/Submit) id t3HDONUT002038; Fri, 17 Apr 2015 08:24:23 -0500 Date: Fri, 17 Apr 2015 08:24:23 -0500 From: Nathan Dautenhahn To: Yuri Cc: freebsd-hackers@FreeBSD.org Subject: Re: Is it possible to check the running kernel signature? Message-ID: <20150417132423.GA65136@trypticon.cs.illinois.edu> References: <553074DE.4070106@rawbw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553074DE.4070106@rawbw.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 13:24:26 -0000 On Thu, Apr 16, 2015 at 07:50:06PM -0700, Yuri wrote: > I came across this horror story: > https://pbs.twimg.com/media/Bd7LUMYCMAAJcqJ.jpg > Three letter agencies subverted the BIOS manufacturers to produce > BIOSes that were/are able to inject the malicious code right into > the FreeBSD kernel during the final BIOS boot stage. This may well > be going on with the modern FreeBSD versions. > > The idea that comes to mind is the ability to verify that the > running kernel wasn't tampered with by comparing it with its disk > image copy. Same with the kernel modules. Kernel can be verified > through the memory mmapped to /dev/mem device. The challenge is that the SMM handler operates as firmware, operating at a higher privilege level than the kernel. However, the kernel could do some type of measurement after each invocation of the SMM handler to ensure that all malicious modifications are detected and patched. This does assume that the attacker doesn't interpose on the system in any other way than SMM interrupts (e.g. DMA). If you want to trust the kernel (which might not be that trustworthy where an attacker could inject surreptitious code more easily than BIOS in my opinion) then the kernel can just do a scan. If you don't trust the kernel you could use a thin hypervisor to measure the memory. Although there you have the practical challenges of measurement, keys, etc. I have been considering ideas along the direction of an isolated measurement component as a use case for the nested kernel (nestedkernel.org). Very interesting direction. ::nathan:: > > Is this idea feasible, and would it make sense to implement it? > > Yuri > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"