Skip to content

uprobes: Fix the memory out of bound overwrite in copy_insn()

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1uprobes: Fix the memory out of bound overwrite in copy_insn()kernel/events/uprobes.c+21 -222 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchSrikar Dronamraju
1/1A-b

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

Read the v1 thread

Cover letter [PATCH 0/1] uprobes: Fix the memory out of bound overwrite in copy_insn()
Quoted 6 lines · Oleg Nesterov

But when I looked at it now I realized that it is very wrong, and it is very easy to crash the kernel (fortunately only root can enable uprobes).

So we need to fix it (and cleanup), I'll try to make the patch asap.

Just truncate the binary after uprobe was enabled, then mmap() the truncated area. This crashes the kernel if nobody else mmaped this area in between.

Oleg.