函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\umip.c Create Date:2022-07-27 09:49:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:xup_umip_exception() - Fixup a general protection fault caused by UMIP*@regs: Registers as saved when entering the #GP handler* The instructions SGDT, SIDT, STR, SMSW and SLDT cause a general protection* fault if executed with CPL > 0 (i

函数原型:bool fixup_umip_exception(struct pt_regs *regs)

返回类型:bool

参数:

类型参数名称
struct pt_regs *regs
321  seg_base等于0
323  unsigned char dummy_data[10] = {0}
325  __useruaddr
329  如果非regs则返回:false
338  如果非user_64bit_mode(regs)则seg_base等于sn_get_seg_base() - Obtain base address of segment descriptor
341  如果seg_base恒等于负1L则返回:false
344  not_copied等于copy_from_user(buf, (void__user * )(seg_base + Return frame for iretq ), buf的长度)
346  nr_copied等于buf的长度减not_copied
353  如果非nr_copied则返回:false
356  sn_init() - initialize struct insn*@insn: &struct insn to be initialized*@kaddr: address (in kernel memory) of instruction (or copy thereof)*@x86_64: !0 for 64-bit kernel or 64-bit app
368  seg_defs等于sn_get_code_seg_params() - Obtain code segment parameters*@regs: Structure with register values as seen when entering kernel mode* Obtain address and operand sizes of the code segment. It is obtained from the* selector contained in the CS register in regs
369  如果seg_defs恒等于负EINVAL则返回:false
372  addr_bytes等于INSN_CODE_SEG_ADDR_SZ(seg_defs)
373  opnd_bytes等于INSN_CODE_SEG_OPND_SZ(seg_defs)
375  sn_get_length() - Get the length of instruction*@insn: &struct insn containing instruction* If necessary, first collects the instruction up to and including the* immediates bytes.
376  如果nr_copied小于length则返回:false
379  umip_inst等于dentify_insn() - Identify a UMIP-protected instruction*@insn: Instruction structure with opcode and ModRM byte
380  如果umip_inst小于0则返回:false
383  umip_pr_warn(regs, "%s instruction cannot be used by applications.\n", umip_insns[umip_inst])
387  如果umip_inst恒等于0F 00 /1 umip_inst恒等于0F 00 /0 则返回:false
390  umip_pr_warn(regs, "For now, expensive software emulation returns the result.\n")
392  如果mulate_umip_insn() - Emulate UMIP instructions and return dummy values*@insn: Instruction structure with operands*@umip_inst: A constant indicating the instruction to emulate*@data: Buffer into which the dummy result is stored*@data_size: Size of the 则返回:false
402  如果X86_MODRM_MOD(value)恒等于3则
403  reg_offset等于sn_get_modrm_rm_off() - Obtain register in r/m part of the ModRM byte*@insn: Instruction containing the ModRM byte*@regs: Register values as seen when entering kernel mode* Returns:* The register indicated by the r/m part of the ModRM byte. The
410  如果reg_offset小于0则返回:false
413  reg_addr等于regsreg_offset
414  memcpy(reg_addr, dummy_data, dummy_data_size)
415  否则
416  uaddr等于sn_get_addr_ref() - Obtain the linear address referred by instruction*@insn: Instruction structure containing ModRM byte and displacement*@regs: Structure with register values as seen when entering kernel mode* Obtain the linear address referred by the
417  如果uaddr恒等于负1L则返回:false
420  nr_copied等于copy_to_user(uaddr, dummy_data, dummy_data_size)
421  如果nr_copied大于0则
427  返回:true
432  Return frame for iretq 加等于length
433  返回:true