Lines Matching full:zero
4 * underflow, reaching zero untested, etc).
67 pr_warn("Weird: refcount_inc_not_zero() reported zero\n"); in lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW()
79 pr_warn("Weird: refcount_add_not_zero() reported zero\n"); in lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW()
88 pr_info("Zero detected: saturated\n"); in check_zero()
91 pr_warn("Zero detected: unsafely reset to max\n"); in check_zero()
94 pr_warn("Still at zero: refcount_inc/add() must not inc-from-0\n"); in check_zero()
103 * zero it should either saturate (when inc-from-zero isn't protected)
104 * or stay at zero (when inc-from-zero is protected) and should WARN for both.
108 refcount_t zero = REFCOUNT_INIT(2); in lkdtm_REFCOUNT_DEC_ZERO() local
111 refcount_dec(&zero); in lkdtm_REFCOUNT_DEC_ZERO()
113 pr_info("attempting bad refcount_dec() to zero\n"); in lkdtm_REFCOUNT_DEC_ZERO()
114 refcount_dec(&zero); in lkdtm_REFCOUNT_DEC_ZERO()
116 check_zero(&zero); in lkdtm_REFCOUNT_DEC_ZERO()
124 * looking only at zero-pinning. in check_negative()
149 pr_info("attempting bad refcount_dec() below zero\n"); in lkdtm_REFCOUNT_DEC_NEGATIVE()
163 pr_info("attempting bad refcount_dec_and_test() below zero\n"); in lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE()
165 pr_warn("Weird: refcount_dec_and_test() reported zero\n"); in lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE()
178 pr_info("attempting bad refcount_sub_and_test() below zero\n"); in lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE()
180 pr_warn("Weird: refcount_sub_and_test() reported zero\n"); in lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE()
186 * A refcount_sub_and_test() by zero when the counter is at zero should act like
193 pr_info("attempting bad refcount_sub_and_test() at zero\n"); in lkdtm_REFCOUNT_SUB_AND_TEST_ZERO()
195 pr_warn("Weird: refcount_sub_and_test() reported zero\n"); in lkdtm_REFCOUNT_SUB_AND_TEST_ZERO()
204 pr_info("Zero detected: stayed at zero\n"); in check_from_zero()
207 pr_info("Zero detected: saturated\n"); in check_from_zero()
210 pr_warn("Zero detected: unsafely reset to max\n"); in check_from_zero()
213 pr_info("Fail: zero not detected, incremented to %d\n", in check_from_zero()
219 * A refcount_inc() from zero should pin to zero or saturate and may WARN.
223 refcount_t zero = REFCOUNT_INIT(0); in lkdtm_REFCOUNT_INC_ZERO() local
225 pr_info("attempting safe refcount_inc_not_zero() from zero\n"); in lkdtm_REFCOUNT_INC_ZERO()
226 if (!refcount_inc_not_zero(&zero)) { in lkdtm_REFCOUNT_INC_ZERO()
227 pr_info("Good: zero detected\n"); in lkdtm_REFCOUNT_INC_ZERO()
228 if (refcount_read(&zero) == 0) in lkdtm_REFCOUNT_INC_ZERO()
229 pr_info("Correctly stayed at zero\n"); in lkdtm_REFCOUNT_INC_ZERO()
231 pr_err("Fail: refcount went past zero!\n"); in lkdtm_REFCOUNT_INC_ZERO()
233 pr_err("Fail: Zero not detected!?\n"); in lkdtm_REFCOUNT_INC_ZERO()
236 pr_info("attempting bad refcount_inc() from zero\n"); in lkdtm_REFCOUNT_INC_ZERO()
237 refcount_inc(&zero); in lkdtm_REFCOUNT_INC_ZERO()
239 check_from_zero(&zero); in lkdtm_REFCOUNT_INC_ZERO()
244 * at zero.
248 refcount_t zero = REFCOUNT_INIT(0); in lkdtm_REFCOUNT_ADD_ZERO() local
250 pr_info("attempting safe refcount_add_not_zero() from zero\n"); in lkdtm_REFCOUNT_ADD_ZERO()
251 if (!refcount_add_not_zero(3, &zero)) { in lkdtm_REFCOUNT_ADD_ZERO()
252 pr_info("Good: zero detected\n"); in lkdtm_REFCOUNT_ADD_ZERO()
253 if (refcount_read(&zero) == 0) in lkdtm_REFCOUNT_ADD_ZERO()
254 pr_info("Correctly stayed at zero\n"); in lkdtm_REFCOUNT_ADD_ZERO()
256 pr_err("Fail: refcount went past zero\n"); in lkdtm_REFCOUNT_ADD_ZERO()
258 pr_err("Fail: Zero not detected!?\n"); in lkdtm_REFCOUNT_ADD_ZERO()
261 pr_info("attempting bad refcount_add() from zero\n"); in lkdtm_REFCOUNT_ADD_ZERO()
262 refcount_add(3, &zero); in lkdtm_REFCOUNT_ADD_ZERO()
264 check_from_zero(&zero); in lkdtm_REFCOUNT_ADD_ZERO()
324 pr_warn("Weird: refcount_inc_not_zero() reported zero\n"); in lkdtm_REFCOUNT_INC_NOT_ZERO_SATURATED()
336 pr_warn("Weird: refcount_add_not_zero() reported zero\n"); in lkdtm_REFCOUNT_ADD_NOT_ZERO_SATURATED()
348 pr_warn("Weird: refcount_dec_and_test() reported zero\n"); in lkdtm_REFCOUNT_DEC_AND_TEST_SATURATED()
360 pr_warn("Weird: refcount_sub_and_test() reported zero\n"); in lkdtm_REFCOUNT_SUB_AND_TEST_SATURATED()