Skip to content
Commit 7aa8c38a authored by Connor Kuehl's avatar Connor Kuehl Committed by Bill Wendling
Browse files

[randstruct] Add randomize structure layout support

The Randstruct feature is a compile-time hardening technique that
randomizes the field layout for designated structures of a code base.
Admittedly, this is mostly useful for closed-source releases of code,
since the randomization seed would need to be available for public and
open source applications.

Why implement it? This patch set enhances Clang’s feature parity with
that of GCC which already has the Randstruct feature. It's used by the
Linux kernel in certain structures to help thwart attacks that depend on
structure layouts in memory.

This patch set is a from-scratch reimplementation of the Randstruct
feature that was originally ported to GCC. The patches for the GCC
implementation can be found here:

  https://www.openwall.com/lists/kernel-hardening/2017/04/06/14

Link: https://lists.llvm.org/pipermail/cfe-dev/2019-March/061607.html


Co-authored-by: default avatarCole Nixon <nixontcole@gmail.com>
Co-authored-by: default avatarConnor Kuehl <cipkuehl@gmail.com>
Co-authored-by: default avatarJames Foster <jafosterja@gmail.com>
Co-authored-by: default avatarJeff Takahashi <jeffrey.takahashi@gmail.com>
Co-authored-by: default avatarJordan Cantrell <jordan.cantrell@mail.com>
Co-authored-by: default avatarNikk Forbus <nicholas.forbus@gmail.com>
Co-authored-by: default avatarTim Pugh <nwtpugh@gmail.com>
Co-authored-by: default avatarBill Wendling <isanbard@gmail.com>
Signed-off-by: default avatarBill Wendling <isanbard@gmail.com>

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121556
parent d5e66c16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment