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: <20191214194626.GA140998@rani.riverdale.lan>
Date:   Sat, 14 Dec 2019 14:46:27 -0500
From:   Arvind Sankar <nivedita@...m.mit.edu>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
        Hans de Goede <hdegoede@...hat.com>,
        Matthew Garrett <matthewgarrett@...gle.com>,
        Ingo Molnar <mingo@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Arvind Sankar <nivedita@...m.mit.edu>
Subject: Re: [PATCH 05/10] efi/libstub: distinguish between native/mixed not
 32/64 bit

On Sat, Dec 14, 2019 at 06:57:30PM +0100, Ard Biesheuvel wrote:
> +
> +#define efi_table_attr(table, attr, instance) ({			\
> +	__typeof__(((table##_t *)0)->attr) __ret;			\
> +	if (efi_is_native()) {						\
> +		__ret = ((table##_t *)instance)->attr;			\
> +	} else {							\
> +		__typeof__(((table##_32_t *)0)->attr) at;		\
> +		at = (((table##_32_t *)(unsigned long)instance)->attr);	\
> +		__ret = (__typeof__(__ret))(unsigned long)at;		\
> +	}								\
> +	__ret;								\
> +})

The casting of `at' is appropriate if the attr is a pointer type which
needs to be zero-extended to 64-bit, but for other fields it is
unnecessary at best and possibly dangerous.  There are probably no
instances currently where it is called for a non-pointer field, but is
it possible to detect if the type is pointer and avoid the cast if not?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ