|
Message-ID: <alpine.DEB.2.21.1804191233500.1563@nanos.tec.linutronix.de> Date: Thu, 19 Apr 2018 12:35:29 +0200 (CEST) From: Thomas Gleixner <tglx@...utronix.de> To: Kees Cook <keescook@...omium.org> cc: Ingo Molnar <mingo@...nel.org>, Joao Moreira <jmoreira@...e.de>, Kernel Hardening <kernel-hardening@...ts.openwall.com>, LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>, Herbert Xu <herbert@...dor.apana.org.au>, "David S. Miller" <davem@...emloft.net>, Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>, Greg KH <gregkh@...uxfoundation.org> Subject: Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes 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 camellia_enc = { > ... > .funcs = { { > ... > .num_blocks = 1, > .fn_u = { .ecb = camellia_enc_blk } > } } > }; > > #define GLUE_FUNC(func, context) \ > static inline void func(void *ctx, u8 *dst, const u8 *src) \ > { __##func((context)ctx, dst, src); } \ > __##func(context ctx, u8 *dst, const u8 *src) > > GLUE_FUNC(camellia_enc_blk, struct camellia_ctx *) > { > ...original function... > } I was about to suggest this before I read to the end of the mail. Yes, that is much more palatable. Thanks, tglx
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.