Skip to content

Instantly share code, notes, and snippets.

@bof
bof / shellshock.patch
Last active August 29, 2015 14:06
shellshock mitigating kernel patch
--- linux-3.10.40/fs/binfmt_elf.c 2014-05-13 14:00:04.000000000 +0200
+++ linux-3.10.40-shellshock/fs/binfmt_elf.c 2014-09-30 08:40:06.616396236 +0200
@@ -307,11 +307,37 @@
current->mm->arg_end = current->mm->env_start = p;
while (envc-- > 0) {
size_t len;
+ size_t shock_len;
+ char *shock_p, shock[48], shock_comm[sizeof(current->comm)];
if (__put_user((elf_addr_t)p, envp++))
return -EFAULT;