All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add stack protector
@ 2024-11-30  1:10 Volodymyr Babchuk
  2024-11-30  1:10 ` [PATCH v2 2/4] xen: common: add ability to enable " Volodymyr Babchuk
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Volodymyr Babchuk @ 2024-11-30  1:10 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, Alistair Francis, Bob Eshleman, Connor Davis,
	Oleksii Kurochko

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 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 (4):
  common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS
  xen: common: add ability to enable stack protector
  xen: arm: enable stack protector feature
  xen: riscv: enable stack protector feature

 Config.mk                            |  2 +-
 stubdom/Makefile                     |  2 ++
 tools/firmware/Rules.mk              |  2 ++
 tools/tests/x86_emulator/testcase.mk |  2 ++
 xen/Makefile                         |  6 ++++++
 xen/arch/arm/Kconfig                 |  1 +
 xen/arch/arm/setup.c                 |  3 +++
 xen/arch/riscv/Kconfig               |  1 +
 xen/arch/riscv/setup.c               |  3 +++
 xen/common/Kconfig                   | 17 ++++++++++++++++
 xen/common/Makefile                  |  1 +
 xen/common/stack-protector.c         | 10 ++++++++++
 xen/include/xen/stack-protector.h    | 29 ++++++++++++++++++++++++++++
 13 files changed, 78 insertions(+), 1 deletion(-)
 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] 23+ messages in thread

end of thread, other threads:[~2024-12-09 12:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30  1:10 [PATCH v2 0/4] Add stack protector Volodymyr Babchuk
2024-11-30  1:10 ` [PATCH v2 2/4] xen: common: add ability to enable " Volodymyr Babchuk
2024-12-02  8:29   ` Jan Beulich
2024-12-03 20:33   ` Andrew Cooper
2024-12-05  3:34     ` Volodymyr Babchuk
2024-12-05 12:52       ` Andrew Cooper
2024-11-30  1:10 ` [PATCH v2 1/4] common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS Volodymyr Babchuk
2024-12-02  8:06   ` Jan Beulich
2024-12-02 10:32     ` Andrew Cooper
2024-12-02 11:31     ` Jan Beulich
2024-11-30  1:10 ` [PATCH v2 3/4] xen: arm: enable stack protector feature Volodymyr Babchuk
2024-11-30 17:06   ` Julien Grall
2024-12-03 22:00   ` Andrew Cooper
2024-12-03 23:16     ` Julien Grall
2024-12-05 19:23       ` Andrew Cooper
2024-12-06  4:46         ` Volodymyr Babchuk
2024-12-09  9:36           ` Jan Beulich
2024-12-09 12:45             ` Volodymyr Babchuk
2024-11-30  1:10 ` [PATCH v2 4/4] xen: riscv: " Volodymyr Babchuk
2024-12-02  8:12   ` Jan Beulich
2024-12-02  8:54     ` oleksii.kurochko
2024-12-02  9:56     ` oleksii.kurochko
2024-12-03 19:30       ` Volodymyr Babchuk

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.