函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\vm86_32.c Create Date:2022-07-27 09:40:49
Last Modify:2022-05-22 10:11:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_sys_vm86

函数原型:static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)

返回类型:long

参数:

类型参数名称
struct vm86plus_struct __user *user_vm86
boolplus
240  tsk等于当前进程
241  vm86等于vm86
243  regs等于current_pt_regs()
244  err等于0
246  err等于security_mmap_addr(0)
247  如果err
266  pr_info_once("Denied a call to vm86(old) from %s[%d] (uid: %d). Set the vm.mmap_min_addr sysctl to 0 and/or adjust LSM mmap_min_addr policy to enable vm86 if you are using a vm86-based DOS emulator.\n", comm, task_pid_nr(当前进程), from_kuid_munged( & init_user_ns, current_uid()))
269  返回:负EPERM
272  如果非vm86
273  如果非vm86等于分配内存并置零则返回:负ENOMEM
275  vm86等于vm86
277  如果saved_sp0则返回:负EPERM
280  如果非access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(user_vm86, plus ? sizeof(structvm86_struct) : sizeof(structvm86plus_struct))则返回:负EFAULT
285  memset( & vm86regs, 0, vm86regs的长度)
286  {get|put}_user_try and catch* get_user_try {* get_user_ex(...);* } get_user_catch(err)
288  get_user_ex(bx, & rmal regs, with special meaning for the segment descriptors..)
289  get_user_ex(cx, & ecx)
290  get_user_ex(dx, & edx)
291  get_user_ex(si, & esi)
292  get_user_ex(di, & edi)
293  get_user_ex(bp, & ebp)
294  get_user_ex(ax, & eax)
295  get_user_ex( Return frame for iretq , & eip)
296  get_user_ex(seg, & cs)
297  cs等于seg
298  get_user_ex(flags, & eflags)
299  get_user_ex(sp, & esp)
300  get_user_ex(seg, & ss)
301  ss等于seg
302  get_user_ex(hese are specific to v86 mode:, & hese are specific to v86 mode:)
303  get_user_ex(ds, & ds)
304  get_user_ex(fs, & fs)
305  get_user_ex(gs, & gs)
307  get_user_ex(flags, & flags)
308  get_user_ex(screen_bitmap, & screen_bitmap)
309  get_user_ex(cpu_type, & cpu_type)
310  get_user_catch(err)
311  如果err则返回:err
314  如果copy_from_user( & int_revectored, & int_revectored, sizeof(structrevectored_struct))则返回:负EFAULT
318  如果copy_from_user( & int21_revectored, & int21_revectored, sizeof(structrevectored_struct))则返回:负EFAULT
322  如果plus
323  如果copy_from_user( & vm86plus, & vm86plus, sizeof(structvm86plus_info_struct))则返回:负EFAULT
326  for vm86 internal use 等于1
327  否则memset( & vm86plus, 0, sizeof(structvm86plus_info_struct))
331  memcpy( & regs32, regs, sizeof(structpt_regs))
332  user_vm86等于user_vm86
339  VEFLAGS等于flags
340  flags与等于SAFE_MASK
341  flags或等于flags按位与SAFE_MASK的反
342  flags或等于No VM86 support
344  * On syscall entry, this is syscall#. On CPU exception, this is error code. * On hw interrupt, it's IRQ number:等于* On syscall entry, this is syscall#. On CPU exception, this is error code. * On hw interrupt, it's IRQ number:
347  :cpu_type恒等于CPU_286
348  veflags_mask等于0
349  退出
350  :cpu_type恒等于CPU_386
351  veflags_mask等于X86_EFLAGS_NT按位或X86_EFLAGS_IOPL
352  退出
353  :cpu_type恒等于CPU_486
354  veflags_mask等于X86_EFLAGS_AC按位或X86_EFLAGS_NT按位或X86_EFLAGS_IOPL
355  退出
356  默认
357  veflags_mask等于X86_EFLAGS_ID按位或X86_EFLAGS_AC按位或X86_EFLAGS_NT按位或X86_EFLAGS_IOPL
358  退出
364  saved_sp0等于sp0
365  lazy_save_gs(gs)
368  禁止抢占()
369  sp0加等于16
371  如果boot_cpu_has(SYSENTER/SYSEXIT )则
372  sysenter_cs等于0
373  refresh_sysenter_cs( & * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct.)
376  This is used when switching tasks or entering/exiting vm86 mode.
377  禁用抢占和中断()
379  如果flags按位与lags masksmark_screen_rdonly(内存信息)
382  memcpy((structkernel_vm86_regs * )regs, & vm86regs, vm86regs的长度)
383  Force syscall return via IRET by making it look as if there was* some work pending()
384  返回:ax