From: Joao Moreira <jmoreira@suse.de>
To: kernel-hardening@lists.openwall.com
Cc: 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: [PATCH 0/4] x86/crypto: Fix function prototypes
Date: Sun, 15 Apr 2018 01:15:38 -0300 [thread overview]
Message-ID: <20180415041542.5364-1-jmoreira@suse.de> (raw)
It is possible to indirectly invoke functions with prototypes that do not
match those of the respectively used function pointers by using void types.
This feature is frequently used as a way of relaxing function invocation,
making it possible that different data structures are passed to different
functions through the same pointer.
Despite the benefits, this can lead to a situation where functions with a
given prototype are invoked by pointers with a different prototype, what is
undesirable as it may prevent the use of heuristics such as prototype
matching-based Control-Flow Integrity, which can be used to prevent
ROP-based attacks.
One way of fixing this situation is through converting the function
prototypes to the one used in the pointer declaration, what means converting
function arguments from a given '<type> *' to a 'void *', and later casting
its uses accordingly throughout the function scope.
Given the above, the current efforts to improve the Linux security, and the
upcoming kernel support to compilers with CFI features, fix prototypes in
x86/crypto algorithms: camellia, cast6, serpent, and twofish.
This patch does not introduce semantic changes to the cryptographic
algorithms, yet, if someone finds relevant, the affected algorithms were
tested with the help of tcrypt.ko without any visible harm.
Joao Moreira (4):
x86/crypto: camellia: Fix function prototypes
x86/crypto: cast6: Fix function prototypes
x86/crypto: serpent: Fix function prototypes
x86/crypto: twofish: Fix function prototypes
arch/x86/crypto/camellia_aesni_avx2_glue.c | 25 ++++++++---------
arch/x86/crypto/camellia_aesni_avx_glue.c | 21 +++++++--------
arch/x86/crypto/camellia_glue.c | 6 ++---
arch/x86/crypto/cast6_avx_glue.c | 22 ++++++---------
arch/x86/crypto/serpent_avx2_glue.c | 14 +++++-----
arch/x86/crypto/serpent_avx_glue.c | 19 ++++++-------
arch/x86/crypto/twofish_avx_glue.c | 30 +++++++++------------
arch/x86/crypto/twofish_glue.c | 7 +++--
arch/x86/crypto/twofish_glue_3way.c | 10 +++----
arch/x86/include/asm/crypto/camellia.h | 43 +++++++++++++-----------------
arch/x86/include/asm/crypto/serpent-avx.h | 25 ++++++++---------
arch/x86/include/asm/crypto/serpent-sse2.h | 30 +++++++++------------
arch/x86/include/asm/crypto/twofish.h | 9 +++----
13 files changed, 108 insertions(+), 153 deletions(-)
--
2.12.0
next reply other threads:[~2018-04-15 4:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-15 4:15 Joao Moreira [this message]
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
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=20180415041542.5364-1-jmoreira@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@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®