Add __alloc_size() for better bounds checking
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 12 repliesIn review
- v15 patches 15 repliesSuperseded
Changes in v2 from the cover letter
- clean up slab function declarations (joe)
- update checkpatch.pl attribute regex (joe)
- explain the Makefile changes better (ojeda, nathan)
v1: https://lore.kernel.org/lkml/[email protected]
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | Compiler Attributes: Add __alloc_size() for better bounds checkingMakefile include/ | +11 | 4 replies | |
| 2/7 | checkpatch: Add __alloc_size() to known $Attributescripts/ | +2 | 0 replies | |
| 3/7 | slab: Clean up function declarationsinclude/ | +35 | 0 replies | |
| 4/7 | slab: Add __alloc_size attributes for better bounds checkinginclude/ | +18 | 3 replies | |
| 5/7 | mm/page_alloc: Add __alloc_size attributes for better bounds checkinginclude/ | +2 | 0 replies | |
| 6/7 | percpu: Add __alloc_size attributes for better bounds checkinginclude/ | +3 | 5 replies | |
| 7/7 | mm/vmalloc: Add __alloc_size attributes for better bounds checkinginclude/ | +11 | 0 replies |
Reviews trailers per patch
2 of 7 patches have a Reviewed-by or Acked-by.
| Patch | Nathan Chancellor | Miguel Ojeda | Nick Desaulniers |
|---|---|---|---|
| 1/7 | R-b | R-b | |
| 2/7 | |||
| 3/7 | |||
| 4/7 | R-b | ||
| 5/7 | |||
| 6/7 | |||
| 7/7 |
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 v2 0/7] Add __alloc_size() for better bounds checking
Hi,
GCC and Clang both use the "alloc_size" attribute to assist with bounds checking around the use of allocation functions. Add the attribute, adjust the Makefile to silence needless warnings, and add the hints to the allocators where possible. These changes have been in use for a while now in GrapheneOS.
To build without warnings, this series needs a couple small fixes for allmodconfig, which I sent separately:
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
I figure I can take this via my "overflow" series, or it could go via -mm?
-Kees
v2:
- clean up slab function declarations (joe)
- update checkpatch.pl attribute regex (joe)
- explain the Makefile changes better (ojeda, nathan)
v1: https://lore.kernel.org/lkml/[email protected]
Kees Cook (7):
Compiler Attributes: Add __alloc_size() for better bounds checking
checkpatch: Add __alloc_size() to known $Attribute
slab: Clean up function declarations
slab: Add __alloc_size attributes for better bounds checking mm/page_alloc: Add __alloc_size attributes for better bounds checking
percpu: Add __alloc_size attributes for better bounds checking mm/vmalloc: Add __alloc_size attributes for better bounds checking
Makefile | 6 ++- include/linux/compiler_attributes.h | 6 +++ include/linux/gfp.h | 2 + include/linux/percpu.h | 3 ++ include/linux/slab.h | 84 +++++++++++++++++------------ include/linux/vmalloc.h | 11 ++++ scripts/checkpatch.pl | 3 +- 7 files changed, 80 insertions(+), 35 deletions(-)
Signature · 1 line
2.30.2