All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add stack protector
@ 2024-12-11  2:04 Volodymyr Babchuk
  2024-12-11  2:04 ` [PATCH v3 2/3] xen: common: add ability to enable " Volodymyr Babchuk
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Volodymyr Babchuk @ 2024-12-11  2:04 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Volodymyr Babchuk, Andrew Cooper, Jan Beulich, Julien Grall,
	Stefano Stabellini, Anthony PERARD, Samuel Thibault,
	Roger Pau Monné, Bertrand Marquis, Michal Orzel,
	Volodymyr Babchuk

Both GCC and Clang support -fstack-protector feature, which add stack
canaries to functions where stack corruption is possible. This series
makes possible to use this feature in Xen. I tested this on ARM64 and
it is working as intended. Tested both with GCC and Clang.

It is hard to enable this feature on x86, as GCC stores stack canary
in %fs:40 by default, but Xen can't use %fs for various reasons. It is
possibly to change stack canary location new newer GCC versions, but
this will change minimal GCC requirement, which is also hard due to
various reasons. So, this series focus mostly on ARM and RISCV.

Changes in v3:

 - Removed patch for riscv
 - Changes in individual patches are covered in their respect commit
 messages

Changes in v2:

 - Patch "xen: common: add ability to enable stack protector" was
   divided into two patches.
 - Rebase onto Andrew's patch that removes -fno-stack-protector-all
 - Tested on RISC-V thanks to Oleksii Kurochko
 - Changes in individual patches covered in their respect commit
 messages


Volodymyr Babchuk (3):
  common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS
  xen: common: add ability to enable stack protector
  xen: arm: enable stack protector feature

 Config.mk                            |  2 +-
 stubdom/Makefile                     |  3 ++
 tools/firmware/Rules.mk              |  2 ++
 tools/tests/x86_emulator/testcase.mk |  2 +-
 xen/Makefile                         |  6 ++++
 xen/arch/arm/Kconfig                 |  1 +
 xen/arch/arm/arm64/head.S            |  3 ++
 xen/arch/arm/setup.c                 |  3 ++
 xen/common/Kconfig                   | 15 +++++++++
 xen/common/Makefile                  |  1 +
 xen/common/stack-protector.c         | 47 ++++++++++++++++++++++++++++
 xen/include/asm-generic/random.h     |  5 +++
 xen/include/xen/stack-protector.h    | 30 ++++++++++++++++++
 13 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 xen/common/stack-protector.c
 create mode 100644 xen/include/xen/stack-protector.h

-- 
2.47.1


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

end of thread, other threads:[~2025-01-15 12:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11  2:04 [PATCH v3 0/3] Add stack protector Volodymyr Babchuk
2024-12-11  2:04 ` [PATCH v3 2/3] xen: common: add ability to enable " Volodymyr Babchuk
2024-12-11  8:16   ` Jan Beulich
2024-12-12  0:47     ` Volodymyr Babchuk
2024-12-12 10:58       ` Jan Beulich
2024-12-12  0:52     ` Andrew Cooper
2024-12-12 10:45       ` Jan Beulich
2025-01-15 12:49   ` Yann Dirson
2024-12-11  2:04 ` [PATCH v3 1/3] common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS Volodymyr Babchuk
2024-12-11  7:49   ` Jan Beulich
2024-12-12  1:08   ` Andrew Cooper
2024-12-11  2:04 ` [PATCH v3 3/3] xen: arm: enable stack protector feature Volodymyr Babchuk
2024-12-11  7:46 ` [PATCH v3 0/3] Add stack protector Jan Beulich
2024-12-12  0:13   ` Volodymyr Babchuk
2024-12-12  1:17     ` Andrew Cooper
2024-12-12  1:19       ` Andrew Cooper
2024-12-12 14:30       ` Jan Beulich
2024-12-12 16:52         ` Jan Beulich
2024-12-19  0:20           ` Andrew Cooper
2024-12-19  7:39             ` Jan Beulich
2025-01-14 13:22       ` Jan Beulich
2025-01-14 13:28         ` Andrew Cooper
2025-01-14 13:47           ` Jan Beulich
2025-01-14 14:15             ` Andrew Cooper
2024-12-12 10:30     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.