path: root/mm/workingset.c
diff options
authorIsaac J. Manjarres <>2019-08-13 15:37:37 -0700
committerLinus Torvalds <>2019-08-13 16:06:52 -0700
commit951531691c4bcaa59f56a316e018bc2ff1ddf855 (patch)
treea26a939586580ccb3c570a558a58f138c55c19af /mm/workingset.c
parentfcf3a5b62f431ce9feeac73afbe128b7b6395dbc (diff)
mm/usercopy: use memory range to be accessed for wraparound check
Currently, when checking to see if accessing n bytes starting at address "ptr" will cause a wraparound in the memory addresses, the check in check_bogus_address() adds an extra byte, which is incorrect, as the range of addresses that will be accessed is [ptr, ptr + (n - 1)]. This can lead to incorrectly detecting a wraparound in the memory address, when trying to read 4 KB from memory that is mapped to the the last possible page in the virtual address space, when in fact, accessing that range of memory would not cause a wraparound to occur. Use the memory range that will actually be accessed when considering if accessing a certain amount of bytes will cause the memory address to wrap around. Link: Fixes: f5509cc18daa ("mm: Hardened usercopy") Signed-off-by: Prasad Sodagudi <> Signed-off-by: Isaac J. Manjarres <> Co-developed-by: Prasad Sodagudi <> Reviewed-by: William Kucharski <> Acked-by: Kees Cook <> Cc: Greg Kroah-Hartman <> Cc: Trilok Soni <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/workingset.c')
0 files changed, 0 insertions, 0 deletions