[lkml]   [2018]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes
>> +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 opaque type and an ugly (and dangerous) type cast.
> What does "compatible with CFI requirements" mean?

For "compatible with CFI requirements", I meant: given a set of
functions that are invoked through a given set of pointers, all
functions and pointers in these sets have the same prototype. I added a
note about this CFI heuristic in the cover letter, but I guess I should
have been clearer there and added something more substantial to the
commit message.

Regarding the changes, this was the most straight-forward way I found to
make the sources compliant with the above, not requiring deeper semantic
changes to the underneath invoking code. On the other hand, I agree that
there is a collateral damage and that an ideal fix would be the other
way around -- removing the opaque type from the pointer instead of
adding it to the functions.

I'll try to think of another way and send if I come to something.


 \ /
  Last update: 2018-04-16 16:36    [W:0.058 / U:5.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site