Skip to content

stackprotector: ascii armor the stack canary

[email protected] kernel-hardening linux-arm-kernel linux-sh lkml 2 versions – Applied

Status from this message: [merged] sh64-ascii-armor-the-sh64-boot-init-stack-canary.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 10 repliesApplied 5/6
  2. v15 patches 1 replySuperseded

Changes in v2 from the cover letter

- improve changelogs
- address Ingo's coding style comments

Patches in v2 Applied · 5/6

#Subject and filesSizeRepliesApplied
1/5random,stackprotect: introduce get_random_canary functioninclude/linux/random.h+21 -01 replyApplied
2/5fork,random: use get_random_canary to set tsk->stack_canarykernel/fork.c+1 -11 replyApplied
3/5x86: ascii armor the x86_64 boot init stack canaryarch/x86/include/asm/stackprotector.h+1 -01 replyApplied
4/5arm64: ascii armor the arm64 boot init stack canaryarch/arm64/include/asm/stackprotector.h+1 -01 replyApplied
5/5sh64: ascii armor the sh64 boot init stack canaryarch/sh/include/asm/stackprotector.h+1 -00 replies
5/5sh64: ascii armor the sh64 boot init stack canaryarch/sh/include/asm/stackprotector.h+1 -01 replyApplied

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchKees Cook
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] stackprotector: ascii armor the stack canary

Zero out the first byte of the stack canary value on 64 bit systems, in order to mitigate unterminated C string overflows.

The null byte both prevents C string functions from reading the canary, and from writing it if the canary value were guessed or obtained through some other means.

Reducing the entropy by 8 bits is acceptable on 64-bit systems, which will still have 56 bits of entropy left, but not on 32 bit systems, so the "ascii armor" canary is only implemented on 64-bit systems.

Inspired by the "ascii armor" code in execshield and Daniel Micay's linux-hardened tree.

Also see https://github.com/thestinger/linux-hardened/

v2:
- improve changelogs
- address Ingo's coding style comments