Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_support.c Create Date:2022-07-28 11:43:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:debug_kfree

Proto:void debug_kfree(void *p)

Type:void

Parameter:

TypeParameterName
void *p
807  If Not p Then Return
809  If p < debug_alloc_pool || p >= debug_alloc_pool + size of debug_alloc_pool_aligned Then
811  kfree(p)
812  Return
814  If Not get_dap_lock() Then
815  __release(Locking is awkward. The debug code is called from all contexts,* including non maskable interrupts. A normal spinlock is not safe* in NMI context. Try to get the debug allocator lock, if it cannot* be obtained after a second then give up)
816  Return
818  h = p - dah_overhead
819  memset(p, r use-after-free poisoning , size - 1)
820  *( p + size - 1) = d-byte of poisoning
821  caller = NULL
822  dah_used -= size
823  h_offset = h - debug_alloc_pool
824  If h_offset < dah_first Then
825  ffset of next header from start of pool = dah_first
826  dah_first = h_offset
827  Else
830  prev = debug_alloc_pool + dah_first
832  When 1 cycle
838  prev_offset = prev - debug_alloc_pool
839  If prev_offset + dah_overhead + size == h_offset Then
840  size += dah_overhead + size
843  h = prev
845  Else
850  If h_offset + dah_overhead + size == ffset of next header from start of pool Then
852  next = debug_alloc_pool + ffset of next header from start of pool
854  size += dah_overhead + size
855  ffset of next header from start of pool = ffset of next header from start of pool
856  memset(next, r use-after-free poisoning , dah_overhead - 1)
857  *( next + dah_overhead - 1) = d-byte of poisoning
859  spin_unlock( & Locking is awkward. The debug code is called from all contexts,* including non maskable interrupts. A normal spinlock is not safe* in NMI context. Try to get the debug allocator lock, if it cannot* be obtained after a second then give up)
Caller
NameDescribe
kdbnearsymkdbnearsym - Return the name of the symbol with the nearest address* less than 'addr'
kdbnearsym_cleanup