linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Improvements of the stackleak gcc plugin
@ 2020-06-04 13:49 Alexander Popov
  2020-06-04 13:49 ` [PATCH 1/5] gcc-plugins/stackleak: Exclude alloca() from the instrumentation logic Alexander Popov
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Alexander Popov @ 2020-06-04 13:49 UTC (permalink / raw)
  To: Kees Cook, Emese Revfy, Miguel Ojeda, Masahiro Yamada,
	Michal Marek, Andrew Morton, Masahiro Yamada,
	Thiago Jung Bauermann, Luis Chamberlain, Jessica Yu,
	Sven Schnelle, Iurii Zaikin, Catalin Marinas, Will Deacon,
	Vincenzo Frascino, Thomas Gleixner, Peter Collingbourne,
	Naohiro Aota, Alexander Monakov, Mathias Krause, PaX Team,
	Brad Spengler, Laura Abbott, Florian Weimer, Alexander Popov,
	kernel-hardening, linux-kbuild, x86, linux-arm-kernel,
	linux-kernel, gcc
  Cc: notify

In this patch series I collected various improvements of the stackleak
gcc plugin.

The first patch excludes alloca() from the stackleak instrumentation logic
to make it simpler.

The second patch is the main improvement. It eliminates an unwanted
side-effect of kernel code instrumentation. This patch is a deep
reengineering of the idea described on grsecurity blog:
  https://grsecurity.net/resolving_an_unfortunate_stackleak_interaction

The third patch adds 'verbose' plugin parameter for printing additional
info about the kernel code instrumentation.

Two other patches disable unneeded stackleak instrumentation for some
files.

I would like to thank Alexander Monakov <amonakov@ispras.ru> for his
advisory on gcc internals.

This patch series was tested for gcc version 4.8, 5, 6, 7, 8, 9, and 10
on x86_64, i386 and arm64.
That was done using the project 'kernel-build-containers':
  https://github.com/a13xp0p0v/kernel-build-containers


Alexander Popov (5):
  gcc-plugins/stackleak: Exclude alloca() from the instrumentation logic
  gcc-plugins/stackleak: Use asm instrumentation to avoid useless
    register saving
  gcc-plugins/stackleak: Add 'verbose' plugin parameter
  gcc-plugins/stackleak: Don't instrument itself
  gcc-plugins/stackleak: Don't instrument vgettimeofday.c in arm64 VDSO

 arch/arm64/kernel/vdso/Makefile        |   3 +-
 include/linux/compiler_attributes.h    |  13 ++
 kernel/Makefile                        |   1 +
 kernel/stackleak.c                     |  16 +-
 scripts/Makefile.gcc-plugins           |   2 +
 scripts/gcc-plugins/stackleak_plugin.c | 260 ++++++++++++++++++++-----
 6 files changed, 232 insertions(+), 63 deletions(-)

-- 
2.25.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-06-23 10:16 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 13:49 [PATCH 0/5] Improvements of the stackleak gcc plugin Alexander Popov
2020-06-04 13:49 ` [PATCH 1/5] gcc-plugins/stackleak: Exclude alloca() from the instrumentation logic Alexander Popov
2020-06-04 14:01   ` Jann Horn
2020-06-04 15:23     ` Alexander Popov
2020-06-09 18:39       ` Kees Cook
2020-06-10 15:24         ` Alexander Popov
2020-06-04 13:49 ` [PATCH 2/5] gcc-plugins/stackleak: Use asm instrumentation to avoid useless register saving Alexander Popov
2020-06-04 15:05   ` Miguel Ojeda
2020-06-09 18:46   ` Kees Cook
2020-06-10 15:47     ` Alexander Popov
2020-06-10 20:03       ` Kees Cook
2020-06-11 23:45         ` Alexander Popov
2020-06-04 13:49 ` [PATCH 3/5] gcc-plugins/stackleak: Add 'verbose' plugin parameter Alexander Popov
2020-06-09 18:47   ` Kees Cook
2020-06-10 15:52     ` Alexander Popov
2020-06-10 20:04       ` Kees Cook
2020-06-04 13:49 ` [PATCH 4/5] gcc-plugins/stackleak: Don't instrument itself Alexander Popov
2020-06-09 18:48   ` Kees Cook
2020-06-04 13:49 ` [PATCH 5/5] gcc-plugins/stackleak: Don't instrument vgettimeofday.c in arm64 VDSO Alexander Popov
2020-06-04 13:58   ` Will Deacon
2020-06-04 14:14     ` Jann Horn
2020-06-04 14:20       ` Alexander Popov
2020-06-04 14:25         ` Jann Horn
2020-06-04 14:44           ` Alexander Popov
2020-06-09 19:09     ` Kees Cook
2020-06-10  7:30       ` Will Deacon
2020-06-10 15:18         ` Alexander Popov
2020-06-23 10:16         ` Alexander Popov
2020-06-04 21:39 ` [PATCH 0/5] Improvements of the stackleak gcc plugin Kees Cook
2020-06-09 19:15 ` Kees Cook
2020-06-10 15:14   ` Alexander Popov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).