Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\ldt.c Create Date:2022-07-28 07:35:36
Last Modify:2022-05-18 16:20:29 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Called on fork from arch_dup_mmap(). Just copy the current LDT state,* the new task is not running, so nothing can be installed.

Proto:int ldt_dup_context(struct mm_struct *old_mm, struct mm_struct *mm)

Type:int

Parameter:

TypeParameterName
struct mm_struct *old_mm
struct mm_struct *mm
362  retval = 0
364  If Not old_mm Then Return 0
367  mutex_lock( & lock)
368  If Not ldt Then Go to out_unlock
371  new_ldt = The caller must call finalize_ldt_struct on the result. LDT starts zeroed.
372  If Not new_ldt Then
373  retval = -ENOMEM
374  Go to out_unlock
377  memcpy(entries, entries, nr_entries * The size of each LDT entry. )
379  After calling this, the LDT is immutable.
381  retval = map_ldt_struct(mm, new_ldt, 0)
382  If retval Then
383  free_ldt_pgtables(mm)
384  free_ldt_struct(new_ldt)
385  Go to out_unlock
387  ldt = new_ldt
389  out_unlock :
390  mutex_unlock( & lock)
391  Return retval