Lines Matching +full:over +full:-
1 // SPDX-License-Identifier: GPL-2.0
29 refcount_t over = REFCOUNT_INIT(REFCOUNT_MAX - 1); in lkdtm_REFCOUNT_INC_OVERFLOW() local
32 refcount_dec(&over); in lkdtm_REFCOUNT_INC_OVERFLOW()
33 refcount_inc(&over); in lkdtm_REFCOUNT_INC_OVERFLOW()
36 refcount_inc(&over); in lkdtm_REFCOUNT_INC_OVERFLOW()
37 refcount_inc(&over); in lkdtm_REFCOUNT_INC_OVERFLOW()
39 overflow_check(&over); in lkdtm_REFCOUNT_INC_OVERFLOW()
45 refcount_t over = REFCOUNT_INIT(REFCOUNT_MAX - 1); in lkdtm_REFCOUNT_ADD_OVERFLOW() local
48 refcount_dec(&over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
49 refcount_dec(&over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
50 refcount_dec(&over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
51 refcount_dec(&over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
52 refcount_add(4, &over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
55 refcount_add(4, &over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
57 overflow_check(&over); in lkdtm_REFCOUNT_ADD_OVERFLOW()
63 refcount_t over = REFCOUNT_INIT(REFCOUNT_MAX); in lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW() local
66 if (!refcount_inc_not_zero(&over)) in lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW()
69 overflow_check(&over); in lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW()
75 refcount_t over = REFCOUNT_INIT(REFCOUNT_MAX); in lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW() local
78 if (!refcount_add_not_zero(6, &over)) in lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW()
81 overflow_check(&over); in lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW()
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.
123 * over-sub, so we have to track our starting position instead of in check_negative()
124 * looking only at zero-pinning. in check_negative()
127 pr_warn("Still at %d: refcount_inc/add() must not inc-from-0\n", in check_negative()
371 for (i = 0; i < INT_MAX - 1; i++) in lkdtm_ATOMIC_TIMING()
374 for (i = INT_MAX; i > 0; i--) in lkdtm_ATOMIC_TIMING()
379 pr_err("atomic timing: out of sync up/down cycle: %u\n", i - 1); in lkdtm_ATOMIC_TIMING()
388 * cd /sys/kernel/debug/provoke-crash
389 * perf stat -B -- cat <(echo REFCOUNT_TIMING) > DIRECT
396 for (i = 0; i < INT_MAX - 1; i++) in lkdtm_REFCOUNT_TIMING()
399 for (i = INT_MAX; i > 0; i--) in lkdtm_REFCOUNT_TIMING()
404 pr_err("refcount: out of sync up/down cycle: %u\n", i - 1); in lkdtm_REFCOUNT_TIMING()