Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 08d45ee8 authored by Kees Cook's avatar Kees Cook
Browse files

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: default avatarMarco Elver <elver@google.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent d70de805
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment