Add __alloc_size()
Status from this message: [merged] percpu-add-__alloc_size-attributes-for-better-bounds-checking.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest8 patches 8 repliesApplied 8/8
- v11 patch 8 repliesSuperseded
Changes in v3 from the cover letter
- move attribute logic around to better handle GCC's weird behavior
- merge __malloc into the __alloc_size macro (Linus)
- refactor attribute positions (Linus)
v2: https://lore.kernel.org/lkml/[email protected]
v1: https://lore.kernel.org/lkml/[email protected]
Patches in v3 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | rapidio: Avoid bogus __alloc_size warningdrivers/ | +5 | 1 reply | Applied |
| 2/8 | Compiler Attributes: add __alloc_size() for better bounds checkingMakefile include/ include/ +2 more | +47 | 1 reply | Applied |
| 3/8 | slab: Clean up function prototypesinclude/ | +34 | 0 replies | Applied |
| 4/8 | slab: Add __alloc_size attributes for better bounds checkinginclude/ | +33 | 5 replies | Applied |
| 5/8 | mm/kvmalloc: Add __alloc_size attributes for better bounds checkinginclude/ | +8 | 0 replies | Applied |
| 6/8 | mm/vmalloc: Add __alloc_size attributes for better bounds checkinginclude/ | +11 | 0 replies | Applied |
| 7/8 | mm/page_alloc: Add __alloc_size attributes for better bounds checkinginclude/ | +2 | 0 replies | Applied |
| 8/8 | percpu: Add __alloc_size attributes for better bounds checkinginclude/ | +3 | 1 reply | Applied |
Reviews trailers per patch
5 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Randy Dunlap | Nick Desaulniers | John Hubbard | Gustavo A. R. Silva | Miguel Ojeda | Dennis Zhou |
|---|---|---|---|---|---|---|
| 1/8 | R-b | R-b | ||||
| 2/8 | T-b | R-b | ||||
| 3/8 | ||||||
| 4/8 | R-b | |||||
| 5/8 | R-b | |||||
| 6/8 | ||||||
| 7/8 | ||||||
| 8/8 | 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 6 reviewers.
Cover letter [PATCH v3 0/8] Add __alloc_size()
Hi Andrew,
This is a refresh of the __alloc_size series you have in -mm currently. This addresses the issues[1] Linus had with attribute location and the redundant use of __malloc. These are meant to replace the following patches:
compiler-attributes-add-__alloc_size-for-better-bounds-checking.patch compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix.patch checkpatch-add-__alloc_size-to-known-attribute.patch slab-clean-up-function-declarations.patch slab-add-__alloc_size-attributes-for-better-bounds-checking.patch mm-page_alloc-add-__alloc_size-attributes-for-better-bounds-checking.patch percpu-add-__alloc_size-attributes-for-better-bounds-checking.patch mm-vmalloc-add-__alloc_size-attributes-for-better-bounds-checking.patch rapidio-avoid-bogus-__alloc_size-warning.patch
Thanks!
-Kees
v3:
- move attribute logic around to better handle GCC's weird behavior
- merge __malloc into the __alloc_size macro (Linus)
- refactor attribute positions (Linus)
v2: https://lore.kernel.org/lkml/[email protected]
v1: https://lore.kernel.org/lkml/[email protected]
Original cover letter:
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.
Kees Cook (8):
rapidio: Avoid bogus __alloc_size warning
Compiler Attributes: add __alloc_size() for better bounds checking
slab: Clean up function prototypes
slab: Add __alloc_size attributes for better bounds checking mm/kvmalloc: Add __alloc_size attributes for better bounds checking mm/vmalloc: 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
Makefile | 15 ++++ drivers/rapidio/devices/rio_mport_cdev.c | 9 ++- include/linux/compiler-gcc.h | 8 ++ include/linux/compiler_attributes.h | 10 +++ include/linux/compiler_types.h | 12 +++ include/linux/gfp.h | 4 +- include/linux/mm.h | 16 ++-- include/linux/percpu.h | 6 +- include/linux/slab.h | 99 +++++++++++++----------- include/linux/vmalloc.h | 22 +++--- scripts/checkpatch.pl | 3 +- 11 files changed, 128 insertions(+), 76 deletions(-)
Signature · 1 line
2.30.2