Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-19 Thread Thomas Gleixner
On Wed, 18 Apr 2018, Kees Cook wrote: > So, instead of the original series, how about something like this: > > Switch function pointers to not use the function cast, and define a > new GLUE_FUNC macro that kinda looks like the tricks used for > syscalls: > > static const struct common_glue_ctx

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-19 Thread Thomas Gleixner
On Wed, 18 Apr 2018, Kees Cook wrote: > So, instead of the original series, how about something like this: > > Switch function pointers to not use the function cast, and define a > new GLUE_FUNC macro that kinda looks like the tricks used for > syscalls: > > static const struct common_glue_ctx

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-18 Thread Kees Cook
On Sun, Apr 15, 2018 at 11:10 PM, Ingo Molnar wrote: > > * Joao Moreira wrote: > >> Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of >> functions which are referenced through 'struct common_glue_func_entry', >> making their prototypes

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-18 Thread Kees Cook
On Sun, Apr 15, 2018 at 11:10 PM, Ingo Molnar wrote: > > * Joao Moreira wrote: > >> Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of >> functions which are referenced through 'struct common_glue_func_entry', >> making their prototypes match those of this struct and,

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-16 Thread João Moreira
+static inline void camellia_enc_blk(void *ctx, u8 *dst, const u8 *src) { - __camellia_enc_blk(ctx, dst, src, false); + __camellia_enc_blk((struct camellia_ctx *) ctx, dst, src, false); } I don't see how this is an improvement: instead of having a proper type there's now an

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-16 Thread João Moreira
+static inline void camellia_enc_blk(void *ctx, u8 *dst, const u8 *src) { - __camellia_enc_blk(ctx, dst, src, false); + __camellia_enc_blk((struct camellia_ctx *) ctx, dst, src, false); } I don't see how this is an improvement: instead of having a proper type there's now an

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-16 Thread Ingo Molnar
* Joao Moreira wrote: > Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of > functions which are referenced through 'struct common_glue_func_entry', > making their prototypes match those of this struct and, consequently, > turning them compatible with CFI

Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-16 Thread Ingo Molnar
* Joao Moreira wrote: > Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of > functions which are referenced through 'struct common_glue_func_entry', > making their prototypes match those of this struct and, consequently, > turning them compatible with CFI requirements. > >

[PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-14 Thread Joao Moreira
Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of functions which are referenced through 'struct common_glue_func_entry', making their prototypes match those of this struct and, consequently, turning them compatible with CFI requirements. Whenever needed, cast 'void *' to

[PATCH 1/4] x86/crypto: camellia: Fix function prototypes

2018-04-14 Thread Joao Moreira
Convert the use of 'struct camellia_ctx *' to 'void *' in prototypes of functions which are referenced through 'struct common_glue_func_entry', making their prototypes match those of this struct and, consequently, turning them compatible with CFI requirements. Whenever needed, cast 'void *' to