From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941174AbcIHTVA (ORCPT ); Thu, 8 Sep 2016 15:21:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49793 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S941149AbcIHTUz (ORCPT ); Thu, 8 Sep 2016 15:20:55 -0400 X-IBM-Helo: d24dlp01.br.ibm.com X-IBM-MailFrom: bauerman@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-security-module@vger.kernel.org From: Thiago Jung Bauermann To: "Eric W. Biederman" Cc: kexec@lists.infradead.org, linux-security-module@vger.kernel.org, linux-ima-devel@lists.sourceforge.net, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Dave Young , Vivek Goyal , Baoquan He , Michael Ellerman , Stewart Smith , Mimi Zohar , Eric Richter , Andrew Morton , Balbir Singh Subject: Re: [PATCH v4 0/5] kexec_file: Add buffer hand-over for the next kernel Date: Thu, 08 Sep 2016 16:20:45 -0300 User-Agent: KMail/4.14.3 (Linux/3.13.0-95-generic; KDE/4.14.13; x86_64; ; ) In-Reply-To: <871t0vlrlv.fsf@x220.int.ebiederm.org> References: <1472579105-26296-1-git-send-email-bauerman@linux.vnet.ibm.com> <8760q7lswz.fsf@x220.int.ebiederm.org> <871t0vlrlv.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16090819-0024-0000-0000-000000FE8C08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16090819-0025-0000-0000-00001594E847 Message-Id: <3106532.NfQxgDJQ20@hactar> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-08_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609080278 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 07 September 2016, 09:19:40 schrieb Eric W. Biederman: > ebiederm@xmission.com (Eric W. Biederman) writes: > > Thiago Jung Bauermann writes: > >> Hello, > >> > >> The purpose of this new version of the series is to fix a small issue > >> that I found, which is that the kernel doesn't remove the memory > >> reservation for the hand-over buffer it received from the previous > >> kernel in the device tree it sets up for the next kernel. The result > >> is that for each successive kexec, a stale hand-over buffer is left > >> behind, wasting memory. > >> > >> This is fixed by changes to kexec_free_handover_buffer and > >> setup_handover_buffer in patch 2. The other change is to fix checkpatch > >> warnings in the last patch. > > > > This is fundamentally broken. You do not increase the integrity of a > > system by dropping integrity checks. > > > > No. No. No. No. > > > > Nacked-by: "Eric W. Biederman" The IMA measurement list can be verified without the need of a checksum over its contents by replaying the PCR extend operations and checking that the result matches the registers in the TPM device. So the fact that it is not part of the kexec segments checksum verification doesn't actually reduce the integrity of the system. Currently, IMA doesn't perform that verification when it restores the measurement list from the kexec handover buffer, so if you believe it's necessary to do that check at boot time, we could do one of the following: 1. Have IMA replay the PCR extend operations when it restores the measurement list from the handover buffer and validate it against the TPM PCRs, or 2. Have a buffer hash in the ima_kexec_hdr that IMA includes in the handover buffer, and verify the buffer checksum before restoring the measurement list. What do you think? > To be constructive the way we have handled similiar situations in the > past (hotplu memory) is to call kexec_load again. Thanks for your suggestion. Unfortunately it's always possible for new measurements to be added to the measurement list between the kexec_file_load and the reboot. We see that happen in practice with system scripts and configuration files that are only read or executed during the reboot process. They are only measured by IMA as a result of the kexec execute. -- []'s Thiago Jung Bauermann IBM Linux Technology Center