Commit 7fb0c7aa authored by Chintan Pandya's avatar Chintan Pandya Committed by Gerrit - the friendly Code Review server
Browse files

highmem: Check overflow in per cpu kmap fix mapping



kmap_atomic_idx_push() is unbounded. If it is crossing
per process limit of KM_TYPE_NR, then

(1) It may end up getting identical mapping for more than
    1 CPUs. This is quite racy. Page corruption may result
    by this.

(2) It may reach a value of 0x100 without checking its
    upper bound KM_TYPE_NR. In ARM implementation of
    kmap_atomic(), this can result into kmap_atomic()
    returning 0 vaddr.

Fix this by putting hard upper bound even in non-debug
environments.

Change-Id: Iaabfc796b08d2580adcfc2d7e6e996c1ff392134
Signed-off-by: default avatarChintan Pandya <cpandya@codeaurora.org>
parent 900abcb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment