Skip to content

ELF interpretor info: align and add random padding

Yann Droneaud kernel-hardening lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3binfmt/elf: use functions for stack manipulationfs/binfmt_elf.c+50 -180 replies
2/3binfmt/elf: align AT_RANDOM arrayfs/binfmt_elf.c+8 -80 replies
3/3binfmt/elf: randomize padding between ELF interp infofs/binfmt_elf.c+30 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ELF interpretor info: align and add random padding

Hi,

The following patches are mostly focused on ensuring AT_RANDOM array is aligned on 16bytes boundary, and while being located at a pseudo-random offset on stack (at most 256 bytes).

This patchset also insert a random sized (at most 15 bytes) padding between AT_RANDOM and AT_PLATFORM and/or AT_BASE_PLATFORM.

It also insert a random sized padding (at most 256 bytes) between those data and the arrays passed to userspace (argv[] + environ[] + auxv[]) as defined by ABI.

Adding random padding around AT_RANDOM, AT_PLATFORM, AT_BASE_PLATEFORM should be viewed as an exercise of cargo-cult security as I'm not aware of any attack that can be prevented with this mechanism in place.

Regards.

Yann Droneaud (3):
binfmt/elf: use functions for stack manipulation binfmt/elf: align AT_RANDOM array binfmt/elf: randomize padding between ELF interp info

 fs/binfmt_elf.c | 110 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 86 insertions(+), 24 deletions(-)
Signature · 1 line
2.21.0