llvm-project/clang/test/Misc
Connor Kuehl 7aa8c38a9e [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: Cole Nixon <nixontcole@gmail.com>
Co-authored-by: Connor Kuehl <cipkuehl@gmail.com>
Co-authored-by: James Foster <jafosterja@gmail.com>
Co-authored-by: Jeff Takahashi <jeffrey.takahashi@gmail.com>
Co-authored-by: Jordan Cantrell <jordan.cantrell@mail.com>
Co-authored-by: Nikk Forbus <nicholas.forbus@gmail.com>
Co-authored-by: Tim Pugh <nwtpugh@gmail.com>
Co-authored-by: Bill Wendling <isanbard@gmail.com>
Signed-off-by: Bill Wendling <isanbard@gmail.com>

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121556
2022-04-09 13:15:36 -07:00
..
Inputs Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
amdgcn.languageOptsOpenCL.cl [OpenCL] Add clang extension for bit-fields. 2021-05-24 12:42:17 +01:00
attr-source-range.cpp
backend-optimization-failure-nodbg.cpp [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
backend-optimization-failure.cpp [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
backend-resource-limit-diagnostics.cl Make DiagnosticInfoResourceLimit's limit param required 2021-09-21 15:27:58 -07:00
backend-stack-frame-diagnostics-attributes.cpp [clang] Don't generate warn-stack-size when the warning is ignored 2021-08-25 14:58:45 +08:00
backend-stack-frame-diagnostics-fallback.cpp [clang] Don't use the AST to display backend diagnostics 2021-10-04 14:14:32 -07:00
backend-stack-frame-diagnostics.cpp [clang] Don't use the AST to display backend diagnostics 2021-10-04 14:14:32 -07:00
caret-diags-macros.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
caret-diags-multiline.cpp
caret-diags-scratch-buffer.c
cc1as-asm-debug.s [DWARF] Make -g with empty assembler source work better. 2019-03-01 20:58:04 +00:00
cc1as-asm.s
cc1as-compress.s [Driver] Clean up -gz & --compress-debug-sections 2020-10-19 23:06:33 -07:00
cc1as-debug-format.s [Driver] Support -gdwarf64 for assembly files 2021-02-17 17:03:34 +07:00
cc1as-split-dwarf.s [Clang] Rename -split-dwarf-file to -split-dwarf-output 2019-06-15 14:07:43 +00:00
clear-ast-before-backend-plugins.c [test] Make sure plugin actually runs in clear-ast-before-backend-plugins.c 2021-10-21 11:38:16 -07:00
clear-ast-before-backend.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
dev-fd-fs.c Basic: Support named pipes natively in SourceManager and FileManager 2020-12-23 14:57:41 -08:00
diag-aka-types.cpp [clang][clangd] Desugar array type. 2021-12-09 20:12:48 +08:00
diag-format.c [clang-cl] Remove the /fallback option 2021-02-04 10:33:16 +01:00
diag-greatergreater.cpp
diag-inline-namespace.cpp Fix assertion when generating diagnostic for inline namespaces 2021-08-20 09:50:24 -04:00
diag-line-wrapping.cpp [Driver] Don't pass -fmessage-length=0 to CC1 2020-03-31 17:12:08 -07:00
diag-macro-backtrace.c
diag-macro-backtrace2.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
diag-mapping.c
diag-mapping2.c
diag-null-bytes-in-line.cpp
diag-presumed.c
diag-special-chars.c
diag-template-diffing-color.cpp
diag-template-diffing-cxx98.cpp
diag-template-diffing.cpp Simplify testcase from c411c1b 2021-08-17 12:38:23 -07:00
diag-template.cpp Fully qualify template template parameters when printing 2021-09-02 15:04:34 -07:00
diag-trailing-null-bytes.cpp
diag-verify.cpp
diagnostic-crash.cpp
driver-verify.c [test] Use %clang_cc1 instead of %clang -cc1 2019-09-27 05:37:06 +00:00
emit-html-insert.c
emit-html.c
error-limit-multiple-notes.cpp
error-limit.c
explicit.cpp [clang]: Remove assertion which checks explicit declaration 2020-08-20 18:15:43 -07:00
ffp-contract.c Making the code compliant to the documentation about Floating Point 2021-11-11 07:40:35 -05:00
find-diagnostic-id.c
freebsd-arm-size_t.c
include-stack-for-note-flag.cpp
inline-asm-clobber-warning.c [llvm][AsmPrinter] Restore source location to register clobber warning 2021-05-14 08:22:57 +00:00
integer-literal-printing.cpp Recommit: Compress formatting of array type names (int [4] -> int[4]) 2021-10-21 11:34:43 -07:00
languageOptsOpenCL.cl
loop-opt-setup.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
macro-backtrace.c
message-length.c [Driver] Don't pass -fmessage-length=0 to CC1 2020-03-31 17:12:08 -07:00
no-warn-in-system-macro.c Fix isInSystemMacro in presence of macro and pasted token 2019-05-16 12:40:00 +00:00
no-warn-in-system-macro.c.inc Fix isInSystemMacro to handle pasted macros 2019-02-01 06:11:44 +00:00
nvptx.languageOptsOpenCL.cl [OpenCL] Add clang extension for bit-fields. 2021-05-24 12:42:17 +01:00
nvptx.unsupported_core.cl [OpenCL] Introduce new method for validating OpenCL target 2021-04-28 16:00:02 +03:00
opencl-c-3.0.incorrect_options.cl [OpenCL] Add support of __opencl_c_device_enqueue feature macro. 2022-01-27 14:25:59 +03:00
ppc-inline-asm-clobber-warning.c [PowerPC] Emit warning when SP is clobbered by asm 2022-01-24 15:12:23 -06:00
pragma-attribute-cxx.cpp [NFC] Remove string parameter of annotation attribute from AST childs. 2020-11-09 16:39:59 +01:00
pragma-attribute-objc.m [NFC] Remove string parameter of annotation attribute from AST childs. 2020-11-09 16:39:59 +01:00
pragma-attribute-strict-subjects.c
pragma-attribute-supported-attributes-list.test [randstruct] Add randomize structure layout support 2022-04-09 13:15:36 -07:00
predefines.c
printer.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
r600.languageOptsOpenCL.cl [OpenCL] Add clang extension for bit-fields. 2021-05-24 12:42:17 +01:00
r600.unsupported_core.cl [OpenCL] Introduce new method for validating OpenCL target 2021-04-28 16:00:02 +03:00
reduced-diags-macros-backtrace.cpp
reduced-diags-macros.cpp
remap-file.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags-bcanalyzer.c
serialized-diags-driver.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags-emit-header-module-misconfig.c [clang] Fix serialized diagnostics edge-cases 2022-01-26 11:21:51 +01:00
serialized-diags-empty-filename.c Make test runnable on read-only file systems. 2021-04-14 13:29:51 -07:00
serialized-diags-frontend.c
serialized-diags-no-category.c
serialized-diags-no-issue.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags-really-long-text.cpp
serialized-diags-single-issue.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags-stable.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags-unknown-argument.c [clang] Fix serialized diagnostics edge-cases 2022-01-26 11:21:51 +01:00
serialized-diags-unknown-target.c [clang] Fix serialized diagnostics edge-cases 2022-01-26 11:21:51 +01:00
serialized-diags.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
serialized-diags.h
serialized-diags.m
show-diag-options.c [Driver] Flip the CC1 default of -fdiagnostics-show-option 2020-03-31 21:59:27 -07:00
tabstop.c
target-invalid-cpu-note.c [AVR] Add more devices 2022-03-25 01:43:41 +00:00
target-parser.c
time-passes.c [test] Fix Misc/time-passes.c 2020-12-09 17:17:28 -08:00
unnecessary-elipses.cpp [Driver] Don't pass -fmessage-length=0 to CC1 2020-03-31 17:12:08 -07:00
unprintable.c [Driver] Don't pass -fmessage-length=0 to CC1 2020-03-31 17:12:08 -07:00
verify.c
warn-in-system-header.c
warn-in-system-header.h
warn-in-system-macro-def.c Fix some tests I broke in r354190 2019-02-16 01:51:19 +00:00
warn-in-system-macro-def.c.inc Fix isInSystemMacro to handle pasted macros 2019-02-01 06:11:44 +00:00
warn-sysheader.cpp
warning-flags-enabled.c
warning-flags-tree.c
warning-flags.c Revert "[NFC] Update new warning to test" 2022-02-15 22:23:26 -05:00
warning-wall.c Reland "[Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects" 2021-10-03 13:05:09 +02:00
win32-macho.c [Driver] Set the default win32-macho debug format to DWARF 2019-07-22 21:46:45 +00:00
working-directory.c
wrong-encoding.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
wrong-encoding2.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00