Home > OS >  For help, every one about copy_to_user cause kernel oops, thanks a lot.
For help, every one about copy_to_user cause kernel oops, thanks a lot.

Time:09-17

Business program calls the kernel interface copy_to_user, but to get user mode of the virtual address to a pte full of 0, the hardware (ARM64 CPU) MMU units produce abnormal missing page into do_page_fault () processing, but directly in a page fault interrupt the following code into the no_context process,

if (! Down_read_trylock (& amp; Mm - & gt; Mmap_sem)) {
if (! User_mode (regs) & amp; & ! Search_exception_tables (regs - & gt; PC))
Goto no_context;


Is wondering, why not at this time in exception_tables table to find the corresponding fixup repair address? I see the arch/arm64/lib/copy_to_user. __arch_copy_to_user function of S, there are related to the abnormal may produce instruction repair operations,

CodePudding user response:

Before the call, try access_ok check user address,
  • Related