Skip to content
Browse files

UPSTREAM: include/linux/poison.h: fix LIST_POISON{1,2} offset

(cherry pick from commit 8a5e5e02fc83aaf67053ab53b359af08c6c49aaf)

Poison pointer values should be small enough to find a room in
non-mmap'able/hardly-mmap'able space.  E.g.  on x86 "poison pointer space"
is located starting from 0x0.  Given unprivileged users cannot mmap
anything below mmap_min_addr, it should be safe to use poison pointers
lower than mmap_min_addr.

The current poison pointer values of LIST_POISON{1,2} might be too big for
mmap_min_addr values equal or less than 1 MB (common case, e.g.  Ubuntu
uses only 0x10000).  There is little point to use such a big value given
the "poison pointer space" below 1 MB is not yet exhausted.  Changing it
to a smaller value solves the problem for small mmap_min_addr setups.

The values are suggested by Solar Designer:

Signed-off-by: Vasily Kulikov <>
Cc: Solar Designer <>
Cc: Thomas Gleixner <>
Cc: "Kirill A. Shutemov" <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Bug: 26429468
Bug: 26186802
Bug: 26429519
Change-Id: Ic51614f6cc98e416282f19af96b9d116eff7c08b
  • Loading branch information...
Vasily Kulikov authored and mikeNG committed Sep 9, 2015
1 parent 1afae97 commit 3af092afbbccb188cc88eb74f0eb7524519c3817
Showing with 2 additions and 2 deletions.
  1. +2 −2 include/linux/poison.h
@@ -19,8 +19,8 @@
* under normal circumstances, used to verify that nobody uses
* non-initialized list entries.
#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA)
#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)
#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA)
#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA)

/********** include/linux/timer.h **********/

0 comments on commit 3af092a

Please sign in to comment.
You can’t perform that action at this time.