in mm/fault.c [172:182]
static inline bool access_error(struct pt_regs *regs, struct vm_area_struct *vma)
{
if (is_write(regs)) {
if (!(vma->vm_flags & VM_WRITE))
return true;
} else {
if (unlikely(!vma_is_accessible(vma)))
return true;
}
return false;
}