Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:refcount_warn_saturate

Proto:void refcount_warn_saturate(refcount_t *r, enum refcount_saturation_type t)

Type:void

Parameter:

TypeParameterName
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  Case t == REFCOUNT_ADD_NOT_ZERO_OVF
19  REFCOUNT_WARN("saturated; leaking memory")
20  Break
21  Case t == REFCOUNT_ADD_OVF
22  REFCOUNT_WARN("saturated; leaking memory")
23  Break
24  Case t == REFCOUNT_ADD_UAF
25  REFCOUNT_WARN("addition on 0; use-after-free")
26  Break
27  Case t == REFCOUNT_SUB_UAF
28  REFCOUNT_WARN("underflow; use-after-free")
29  Break
30  Case t == REFCOUNT_DEC_LEAK
31  REFCOUNT_WARN("decrement hit 0; leaking memory")
32  Break
33  Default
34  REFCOUNT_WARN("unknown saturation event!?")
Caller
NameDescribe
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.