Skip to content

Commit 8a5e5e0

Browse files
segoontorvalds
authored andcommitted
include/linux/poison.h: fix LIST_POISON{1,2} offset
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: http://www.openwall.com/lists/oss-security/2015/05/02/6 Signed-off-by: Vasily Kulikov <[email protected]> Cc: Solar Designer <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ecf1a3d commit 8a5e5e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/poison.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* under normal circumstances, used to verify that nobody uses
2020
* non-initialized list entries.
2121
*/
22-
#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA)
23-
#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)
22+
#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA)
23+
#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA)
2424

2525
/********** include/linux/timer.h **********/
2626
/*

0 commit comments

Comments
 (0)