Skip to contentSkip to conversation

arm: Missing memset in setup_frametable_mappings

DISCUSSION [email protected] 2 participants 2 messages Mar 10, 2016

lore
Share & tools
lore
#0 lore raw

Hello Ian, Stefano,
I believe there is a bug in setup_frametable_mappings() where the function allocates pages for pagetables via alloc_boot_pages() but does not zero them out. This results in a crash on Qualcomm systems when prefetching is enabled since the processor is free to prefetch a location for which it finds a 'valid'
translation in the page tables, but actually holds uninitialized memory.

A memset to 0 of the variable 'second' for the nr_second pages that were allocated fixes the problem.

I didn't see a fix in master branch but may have missed a bug report on the mailing list.

Thanks,
Vikram
Qualcomm Technologies Inc, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 10.03.16 at 01:08, <[email protected]> wrote:

I believe there is a bug in setup_frametable_mappings() where the function allocates pages for pagetables via alloc_boot_pages() but does not zero them out. This results in a crash on Qualcomm systems when prefetching is enabled since the processor is free to prefetch a location for which it finds a 'valid'
translation in the page tables, but actually holds uninitialized memory.

Quoted 5 lines

A memset to 0 of the variable 'second' for the nr_second pages that were allocated fixes the problem.

I didn't see a fix in master branch but may have missed a bug report on the mailing list.

Why don't you submit your patch then? That said, I'm getting the impression that all three uses of alloc_boot_pages() in arm/mm.c have this problem, not just the one you mention.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel