<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 30-Apr-2019, at 1:29 PM, Aneesh Kumar K.V <<a href="mailto:aneesh.kumar@linux.ibm.com" class="">aneesh.kumar@linux.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">This patch fixes the below crash by making sure we touch the subpage protection<br class="">related structures only if we know they are allocated on the platform. With<br class="">radix translation we don't allocate hash context at all and trying to access<br class="">subpage_prot_table results in<br class=""><br class=""> Faulting instruction address: 0xc00000000008bdb4<br class=""> Oops: Kernel access of bad area, sig: 11 [#1]<br class=""> LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV<br class=""> ....<br class=""> NIP [c00000000008bdb4] sys_subpage_prot+0x74/0x590<br class=""> LR [c00000000000b688] system_call+0x5c/0x70<br class=""> Call Trace:<br class=""> [c00020002c6b7d30] [c00020002c6b7d90] 0xc00020002c6b7d90 (unreliable)<br class=""> [c00020002c6b7e20] [c00000000000b688] system_call+0x5c/0x70<br class=""> Instruction dump:<br class=""> fb61ffd8 fb81ffe0 fba1ffe8 fbc1fff0 fbe1fff8 f821ff11 e92d1178 f9210068<br class=""> 39200000 e92d0968 ebe90630 e93f03e8 <eb891038> 60000000 3860fffe e9410068<br class=""><br class="">We also move the subpage_prot_table with mmp_sem held to avoid racec<br class="">between two parallel subpage_prot syscall.<br class=""><br class="">Reported-by: Sachin Sant <<a href="mailto:sachinp@linux.vnet.ibm.com" class="">sachinp@linux.vnet.ibm.com</a>><br class="">Signed-off-by: Aneesh Kumar K.V <<a href="mailto:aneesh.kumar@linux.ibm.com" class="">aneesh.kumar@linux.ibm.com</a>><br class="">—</div></div></blockquote><div><br class=""></div>Thanks for the patch. Fixes the kernel crash.</div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Tested-by: Sachin Sant <</span><a href="mailto:sachinp@linux.vnet.ibm.com" class="">sachinp@linux.vnet.ibm.com</a><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">></span></div><br class=""><div class="">Thanks</div><div class="">-Sachin</div></body></html>