lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fbdc33c-8819-40b6-b0d3-5d64833c9932@amazon.com>
Date:   Mon, 1 Jun 2020 10:07:11 +0300
From:   "Paraschiv, Andra-Irina" <andraprs@...zon.com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Greg KH <gregkh@...uxfoundation.org>
CC:     <linux-kernel@...r.kernel.org>,
        Anthony Liguori <aliguori@...zon.com>,
        Colm MacCarthaigh <colmmacc@...zon.com>,
        Bjoern Doebel <doebel@...zon.de>,
        David Woodhouse <dwmw@...zon.co.uk>,
        Frank van der Linden <fllinden@...zon.com>,
        Alexander Graf <graf@...zon.de>,
        Martin Pohlack <mpohlack@...zon.de>,
        Matt Wilson <msw@...zon.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Balbir Singh <sblbir@...zon.com>,
        Stefano Garzarella <sgarzare@...hat.com>,
        Stefan Hajnoczi <stefanha@...hat.com>,
        Stewart Smith <trawets@...zon.com>,
        Uwe Dannowski <uwed@...zon.de>, <kvm@...r.kernel.org>,
        <ne-devel-upstream@...zon.com>
Subject: Re: [PATCH v3 02/18] nitro_enclaves: Define the PCI device interface



On 01/06/2020 05:59, Benjamin Herrenschmidt wrote:
> On Wed, 2020-05-27 at 00:21 +0200, Greg KH wrote:
>>> There are a couple of data structures with more than one member and multiple
>>> field sizes. And for the ones that are not, gathered as feedback from
>>> previous rounds of review that should consider adding a "flags" field in
>>> there for further extensibility.
>> Please do not do that in ioctls.  Just create new calls instead of
>> trying to "extend" existing ones.  It's always much easier.
>>
>>> I can modify to have "__packed" instead of the attribute callout.
>> Make sure you even need that, as I don't think you do for structures
>> like the above one, right?
> Hrm, my impression (granted I only just started to look at this code)
> is that these are protocol messages with the PCI devices, not strictly
> just ioctl arguments (though they do get conveyed via such ioctls).
>
> Andra-Irina, did I get that right ? :-)

Correct, these data structures having "__packed" attribute map the 
messages (requests / replies) for the communication with the NE PCI device.

The data structures from the ioctl commands are not directly used as 
part of the communication with the NE PCI device, but several fields of 
them e.g. enclave start flags. Some of the fields from the NE PCI device 
data structures e.g. the physical address of a memory region (gpa) are 
set by the internal kernel logic.

>
> That said, I still think that by carefully ordering the fields and
> using explicit padding, we can avoid the need of the packed attributed.

Regarding your question in the previous mail from this thread and the 
mention above on the same topic, that should be possible. IIRC, there 
were 2 data structures remaining with "__packed" attribute.

Thank you, Ben.

Andra



Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ