Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 21 Nov 2019 18:21:04 -0800
From: Eric Biggers <>
To: Kees Cook <>
Cc: Herbert Xu <>,
	João Moreira <>,
	Ard Biesheuvel <>,
	Sami Tolvanen <>,
	Stephan Mueller <>,,,,
Subject: Re: [PATCH v6 0/8] crypto: x86: Fix indirect function call casts

On Thu, Nov 21, 2019 at 05:03:26PM -0800, Kees Cook wrote:
> v6:
> - minimize need for various internal casts (ebiggers)
> - clarify comments (ebiggers)
> - switch all context pointers to const (ebiggers)
> v5:
> v4:
> v3:
> Hi,
> Now that Clang's CFI has been fixed to do the right thing with extern
> asm functions, this patch series is much simplified. Repeating patch
> 1's commit log here:
>     The crypto glue performed function prototype casting to make indirect
>     calls to assembly routines. Instead of performing casts at the call
>     sites (which trips Control Flow Integrity prototype checking), switch
>     each prototype to a common standard set of arguments which allows the
>     incremental removal of the existing macros. In order to keep pointer
>     math unchanged, internal casting between u128 pointers and u8 pointers
>     is added.
> With this series (and the Clang LTO+CFI series) I am able to boot x86
> with all crytpo selftests enabled without tripping any CFI checks.
> Thanks!
> -Kees
> Kees Cook (8):
>   crypto: x86/glue_helper: Regularize function prototypes
>   crypto: x86/serpent: Remove glue function macros usage
>   crypto: x86/camellia: Remove glue function macro usage
>   crypto: x86/twofish: Remove glue function macro usage
>   crypto: x86/cast6: Remove glue function macro usage
>   crypto: x86/aesni: Remove glue function macro usage
>   crypto: x86/glue_helper: Remove function prototype cast helpers
>   crypto, x86/sha: Eliminate casts on asm implementations

This patchset doesn't actually compile until patch 6/8, due to
-Werror=incompatible-pointer-types in the kernel's top-level Makefile.  It's
generally expected that every kernel commit compiles, and I'm not sure it's a
good idea to allow any exceptions.

The easiest solution would be to just squash the first 6 patches together into
one big patch.

Alternatively, 'ccflags-y := -Wno-error=incompatible-pointer-types' could be
added to arch/x86/crypto/Makefile in patch 1 and removed in patch 7.

- Eric

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.