函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:arch\x86\kernel\umip.c Create Date:2022-07-27 09:49:50
首页 Copyright©Brick

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
/**
 * force_sig_info_umip_fault() - Force a SIGSEGV with SEGV_MAPERR
 * @addr:   Address that caused the signal
 * @regs:   Register set containing the instruction pointer
 *
 * Force a SIGSEGV signal with SEGV_MAPERR as the error code. This function is
 * intended to be used to provide a segmentation fault when the result of the
 * UMIP emulation could not be copied to the user space memory.
 *
 * Returns: none
 */
static void force_sig_info_umip_fault(void __user *addr, struct pt_regs *regs)
{
    struct task_struct *tsk = current;
 
    tsk->thread.cr2     = (unsigned long)addr;
    tsk->thread.error_code  = X86_PF_USER | X86_PF_WRITE;
    tsk->thread.trap_nr = X86_TRAP_PF;
 
    force_sig_fault(SIGSEGV, SEGV_MAPERR, addr);
 
    if (!(show_unhandled_signals && unhandled_signal(tsk, SIGSEGV)))
        return;
 
    umip_pr_err(regs, "segfault in emulation. error%x\n",
            X86_PF_USER | X86_PF_WRITE);
}