All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4]  Add/enable stack protector
@ 2025-01-14  4:25 Volodymyr Babchuk
  2025-01-14  4:25 ` [PATCH v4 3/4] xen: arm: enable stack protector feature Volodymyr Babchuk
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Volodymyr Babchuk @ 2025-01-14  4:25 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Volodymyr Babchuk, Andrew Cooper, Anthony PERARD, Michal Orzel,
	Jan Beulich, Julien Grall, Roger Pau Monné,
	Stefano Stabellini, Samuel Thibault, Bertrand Marquis,
	Volodymyr Babchuk, Oleksii Kurochko, Community Manager

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
attempt to do this uncovered a whole host problems with GNU ld.
So, this series focus mostly on ARM.

Changes in v4:

 - Added patch to CHANGELOG.md
 - Removed stack-protector.h because we dropped support for
   Xen's built-in RNG code and rely only on own implementation
 - Changes in individual patches are covered in their respect commit
 messages

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

 CHANGELOG.md                         |  1 +
 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/arm64/head.S            |  3 ++
 xen/arch/x86/boot/Makefile           |  1 +
 xen/common/Kconfig                   | 15 ++++++++
 xen/common/Makefile                  |  1 +
 xen/common/stack-protector.c         | 51 ++++++++++++++++++++++++++++
 12 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 xen/common/stack-protector.c

-- 
2.47.1


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

end of thread, other threads:[~2025-02-13 15:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14  4:25 [PATCH v4 0/4] Add/enable stack protector Volodymyr Babchuk
2025-01-14  4:25 ` [PATCH v4 3/4] xen: arm: enable stack protector feature Volodymyr Babchuk
2025-02-13 14:20   ` Julien Grall
2025-02-13 14:35     ` Julien Grall
2025-01-14  4:25 ` [PATCH v4 4/4] CHANGELOG.md: Mention stack-protector feature Volodymyr Babchuk
2025-02-13 14:18   ` Oleksii Kurochko
2025-01-14  4:25 ` [PATCH v4 2/4] xen: common: add ability to enable stack protector Volodymyr Babchuk
2025-01-14  9:31   ` Andrew Cooper
2025-01-14  4:25 ` [PATCH v4 1/4] common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS Volodymyr Babchuk
2025-01-14  9:32 ` [PATCH v4 0/4] Add/enable stack protector Andrew Cooper
2025-02-13 13:54   ` Volodymyr Babchuk
2025-02-13 14:07     ` [PATCH v4 for-4.20(?) " Andrew Cooper
2025-02-13 14:21       ` Oleksii Kurochko
2025-02-13 14:24         ` Julien Grall
2025-02-13 14:28           ` Oleksii Kurochko
2025-02-13 14:26         ` Oleksii Kurochko
2025-02-13 14:30           ` Jan Beulich
2025-02-13 15:09             ` Andrew Cooper
2025-02-13 14:31           ` Andrew Cooper

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.