diff options
author | Kees Cook <keescook@chromium.org> | 2024-01-26 22:09:50 -0800 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2024-02-29 13:38:01 -0800 |
commit | 08d45ee84bb2650e237e150caca87cc4ded9b3e2 (patch) | |
tree | 0f0474672597c717e276bcd41242f7d50535aa9c /lib/atomic64_test.c | |
parent | d70de8054c58d7bd9a4654c9f4797d29fa46d545 (diff) |
overflow: Introduce wrapping_assign_add() and wrapping_assign_sub()
This allows replacements of the idioms "var += offset" and "var -=
offset" with the wrapping_assign_add() and wrapping_assign_sub() helpers
respectively. They will avoid wrap-around sanitizer instrumentation.
Add to the selftests to validate behavior and lack of side-effects.
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'lib/atomic64_test.c')
0 files changed, 0 insertions, 0 deletions