Skip to content
Commit 737326aa authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Will Deacon
Browse files

fs/proc: kcore: use kcore_list type to check for vmalloc/module address



Instead of passing each start address into is_vmalloc_or_module_addr()
to decide whether it falls into either the VMALLOC or the MODULES region,
we can simply check the type field of the current kcore_list entry, since
it will be set to KCORE_VMALLOC based on exactly the same conditions.

As a bonus, when reading the KCORE_TEXT region on architectures that have
one, this will avoid using vread() on the region if it happens to intersect
with a KCORE_VMALLOC region. This is due the fact that the KCORE_TEXT
region is the first one to be added to the kcore region list.

Reported-by: default avatarTan Xiaojun <tanxiaojun@huawei.com>
Tested-by: default avatarTan Xiaojun <tanxiaojun@huawei.com>
Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarLaura Abbott <labbott@redhat.com>
Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 06c35ef1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment