mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "João Moreira" <jmoreira@suse.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	gregkh@linuxfoundation.org, keescook@chromium.org
Subject: Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes
Date: Mon, 16 Apr 2018 11:35:58 -0300	[thread overview]
Message-ID: <15bd0d05-e046-1b35-9f14-91e507e6b162@suse.de> (raw)
In-Reply-To: <20180416061044.z6eb4psw2sbszemb@gmail.com>

> 
>> +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.

Tks,
João.

  reply	other threads:[~2018-04-16 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-15  4:15 [PATCH 0/4] x86/crypto: " Joao Moreira
2018-04-15  4:15 ` [PATCH 1/4] x86/crypto: camellia: " Joao Moreira
2018-04-16  6:10   ` Ingo Molnar
2018-04-16 14:35     ` João Moreira [this message]
2018-04-18 16:07     ` Kees Cook
2018-04-19 10:35       ` Thomas Gleixner
2018-04-15  4:15 ` [PATCH 2/4] x86/crypto: cast6: " Joao Moreira
2018-04-15  4:15 ` [PATCH 3/4] x86/crypto: serpent: " Joao Moreira
2018-04-15  4:15 ` [PATCH 4/4] x86/crypto: twofish: " Joao Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15bd0d05-e046-1b35-9f14-91e507e6b162@suse.de \
    --to=jmoreira@suse.de \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®