函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\refcount.c Create Date:2022-07-27 07:22:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:refcount_warn_saturate

函数原型:void refcount_warn_saturate(refcount_t *r, enum refcount_saturation_type t)

返回类型:void

参数:

类型参数名称
refcount_t *r
enum refcount_saturation_typet
15  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
18  :t恒等于REFCOUNT_ADD_NOT_ZERO_OVF
19  REFCOUNT_WARN("saturated; leaking memory")
20  退出
21  :t恒等于REFCOUNT_ADD_OVF
22  REFCOUNT_WARN("saturated; leaking memory")
23  退出
24  :t恒等于REFCOUNT_ADD_UAF
25  REFCOUNT_WARN("addition on 0; use-after-free")
26  退出
27  :t恒等于REFCOUNT_SUB_UAF
28  REFCOUNT_WARN("underflow; use-after-free")
29  退出
30  :t恒等于REFCOUNT_DEC_LEAK
31  REFCOUNT_WARN("decrement hit 0; leaking memory")
32  退出
33  默认
34  REFCOUNT_WARN("unknown saturation event!?")
调用者
名称描述
refcount_add_not_zero_add_not_zero - add a value to a refcount unless it is 0*@i: the value to add to the refcount*@r: the refcount* Will saturate at REFCOUNT_SATURATED and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the
refcount_add_add - add a value to a refcount*@i: the value to add to the refcount*@r: the refcount* Similar to atomic_add(), but will saturate at REFCOUNT_SATURATED and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the
refcount_sub_and_test_sub_and_test - subtract from a refcount and test if it is 0*@i: amount to subtract from the refcount*@r: the refcount* Similar to atomic_dec_and_test(), but it will WARN, return false and* ultimately leak on underflow and will fail to decrement when
refcount_dec_dec - decrement a refcount*@r: the refcount* Similar to atomic_dec(), it will WARN on underflow and fail to decrement* when saturated at REFCOUNT_SATURATED.* Provides release memory ordering, such that prior loads and stores are done* before.