overflow: Introduce wrapping helpers
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest3 patches 3 repliesIn review
- v63 patches 3 repliesSuperseded
- v53 patches 4 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 3 patches | 3 replies | Superseded | |
| v3 | 3 patches | 10 replies | Superseded | |
| v2 | 5 patches | 4 replies | Superseded | |
| v1 | 5 patches | 4 replies | Superseded |
Patches in v7 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | overflow: Adjust check_*_overflow() kern-doc to reflect resultsinclude/ | +9 | 1 reply | |
| 2/3 | overflow: Introduce wrapping_add(), wrapping_sub(), and wrapping_mul()include/ lib/ | +68 | 0 replies | |
| 3/3 | overflow: Introduce wrapping_assign_add() and wrapping_assign_sub()include/ lib/ | +75 | 2 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Gustavo A. R. Silva | Marco Elver | Mark Rutland |
|---|---|---|---|
| 1/3 | R-b | A-b | |
| 2/3 | R-b | R-b | A-b |
| 3/3 | R-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v7 0/3] overflow: Introduce wrapping helpers
v7: - further kern-doc cleanups (Mark)
v6: https://lore.kernel.org/all/[email protected]/
v5: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/
Hi,
In preparation for gaining instrumentation for signed[1], unsigned[2], and pointer[3] wrap-around, expand the overflow header to include wrap-around helpers that can be used to annotate arithmetic where wrapped calculations are expected (e.g. atomics).
After spending time getting the unsigned integer wrap-around sanitizer running warning-free on a basic x86_64 boot[4], I think the add/sub/mul helpers first argument being the output type makes the most sense (as suggested by Rasmus).
-Kees
Kees Cook (3):
overflow: Adjust check_*_overflow() kern-doc to reflect results
overflow: Introduce wrapping_add(), wrapping_sub(), and wrapping_mul()
overflow: Introduce wrapping_assign_add() and wrapping_assign_sub()
include/linux/overflow.h | 101 ++++++++++++++++++++++++++++++++++----- lib/overflow_kunit.c | 67 ++++++++++++++++++++++++-- 2 files changed, 152 insertions(+), 16 deletions(-)
Signature · 1 line
2.34.1