Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\binfmt_flat.c Create Date:2022-07-28 20:29:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:These are the functions used to load flat style executables and shared* libraries. There is no binary dependent code anywhere else.

Proto:static int load_flat_binary(struct linux_binprm *bprm)

Type:int

Parameter:

TypeParameterName
struct linux_binprm *bprm
925  regs = current_pt_regs()
926  stack_len = 0
931  memset( & libinfo, 0, size of libinfo )
943  stack_len += (argc + 1) * size of *
944  stack_len += (envc + 1) * size of *
945  stack_len = @a is a power of 2 value (stack_len, User data (stack) also needs to be aligned.* Here we can be a bit looser than the data sections since this* needs to only meet arch ABI requirements.)
947  res = load_flat_file(bprm, & libinfo, 0, & stack_len)
948  If res < 0 Then Return res
952  When i < MAX_SHARED_LIBS cycle
953  If Not Has this library been loaded? Then Continue
955  When j < MAX_SHARED_LIBS cycle
960  p -= j + 1
966  stall the new credentials for this executable
968  set_binfmt( & flat_format)
971  res = Finalizes the stack vm_area_struct. The flags and permissions are updated,* the stack is optionally relocated, and some extra space is added.
972  If Not res Then res = reate_flat_tables() parses the env- and arg-strings in new user* memory and creates the pointer tables from them, and puts their* addresses on the "stack", recording the new stack pointer value.
985  If res Then Return res
992  start_addr = Start address for this module
1008  FLAT_PLAT_INIT(regs)
1011  Runs immediately before start_thread() takes over.
1012  pr_debug("start_thread(regs=0x%p, entry=0x%lx, start_stack=0x%lx)\n", regs, start_addr, start_stack)
1014  start_thread(regs, start_addr, start_stack)
1016  Return 0