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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Nov 2018 14:38:36 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Roman Kagan <rkagan@...tuozzo.com>
cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>,
        Nadav Amit <nadav.amit@...il.com>
Subject: Re: [PATCH] x86/hyper-v: define structures from TLFS as packed

On Fri, 30 Nov 2018, Roman Kagan wrote:

> On Fri, Nov 30, 2018 at 01:15:11PM +0100, Vitaly Kuznetsov wrote:
> > Without 'packed' compiler is free to add optimization paddings and re-order
> > structure fields for randomization/optimization. And structures from
> > hyperv-tlfs.h are used for hypervisor-guest communication, we need to
> > ultimately forbid such practices.
> 
> Note that __packed also reduces the structure alignment to 1, which is
> not necessarily what you want.
> 
> E.g. some of these structures are passed by pointer to the hypercall,
> which requires its arguments to be 8byte-aligned.  I'm also not sure
> that passing unaligned argument to [rw]msr is ok, need to double-check.

If you have alignment requirements then you need to express them too.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ