Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\uprobes.c Create Date:2022-07-28 13:44:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__update_ref_ctr

Proto:static int __update_ref_ctr(struct mm_struct *mm, unsigned long vaddr, short d)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longvaddr
shortd
382  If Not vaddr || Not d Then Return -EINVAL
385  ret = get_user_pages_remote(NULL, mm, vaddr, 1, check pte is writable , & page, & vma, NULL)
387  If Value for the false possibility is greater at compile time(ret <= 0) Then
392  Return If ret == 0 Then -EBUSY Else ret
395  kaddr = kmap_atomic(page)
396  ptr = kaddr + (vaddr & ~PAGE_MASK)
398  If Value for the false possibility is greater at compile time( * ptr + d < 0) Then
399  pr_warn("ref_ctr going negative. vaddr: 0x%lx, curr val: %d, delta: %d\n", vaddr, * ptr, d)
401  ret = -EINVAL
402  Go to out
405  ptr += d
406  ret = 0
407  out :
408  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(kaddr)
409  put_page(page)
410  Return ret
Caller
NameDescribe
update_ref_ctr
delayed_ref_ctr_inc@vma contains reference counter, not the probed instruction.