From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932667AbcHINhn (ORCPT ); Tue, 9 Aug 2016 09:37:43 -0400 Received: from smtp-out4.electric.net ([192.162.216.185]:57762 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932594AbcHINhl convert rfc822-to-8bit (ORCPT ); Tue, 9 Aug 2016 09:37:41 -0400 From: David Laight To: "'Thiago Jung Bauermann'" , Mimi Zohar CC: Dave Young , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-ima-devel@lists.sourceforge.net" , "linuxppc-dev@lists.ozlabs.org" Subject: RE: [PATCH 1/7] ima: on soft reboot, restore the measurement list Thread-Topic: [PATCH 1/7] ima: on soft reboot, restore the measurement list Thread-Index: AQHR8kCP6VKFbjb4REORxHLWiYC5naBAoIRA Date: Tue, 9 Aug 2016 13:35:13 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D5F50D431@AcuExch.aculab.com> References: <1470313475-20090-1-git-send-email-zohar@linux.vnet.ibm.com> <87wpjqtdg8.fsf@concordia.ellerman.id.au> <1470747673.2881.118.camel@linux.vnet.ibm.com> <3544655.o5QPxko4Ba@hactar> In-Reply-To: <3544655.o5QPxko4Ba@hactar> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thiago Jung Bauermann > Sent: 09 August 2016 14:19 ... > > > > +/* Some details preceding the binary serialized measurement list */ > > > > +struct ima_kexec_hdr { > > > > + unsigned short version; > > > > + unsigned long buffer_size; > > > > + unsigned long count; > > > > +} __packed; > > > > + > > > > > > Am I understanding it correctly that this structure is passed between > > > kernels? > > Yes, the header prefixes the measurement list, which is being passed on > > the same computer to the next kernel. Could the architecture (eg. > > LE/BE) change between soft re-boots? > > Yes. I am able to boot a BE kernel from an LE kernel with my patches. 64bit kernel to/from 32bit one? (if that makes sense on the hardware). > Whether we want to support that or not is another question... In which case shouldn't they be annotated with the endianness?? Also why '__packed' - guarantees sub-optimal code generation. Much better to include explicit padding to align everything. David