Skip to content

Commit d2a43e7

Browse files
committed
Merge tag 'hardening-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - fix required Clang version for CC_HAS_COUNTED_BY_PTR (Nathan Chancellor) - update Coccinelle script used for kmalloc_obj * tag 'hardening-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: init/Kconfig: Require a release version of clang-22 for CC_HAS_COUNTED_BY_PTR coccinelle: kmalloc_obj: Remove default GFP_KERNEL arg
2 parents 51088b9 + 7a618ca commit d2a43e7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

init/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ config CC_HAS_COUNTED_BY
146146
config CC_HAS_COUNTED_BY_PTR
147147
bool
148148
# supported since clang 22
149-
default y if CC_IS_CLANG && CLANG_VERSION >= 220000
149+
default y if CC_IS_CLANG && CLANG_VERSION >= 220100
150150
# supported since gcc 16.0.0
151151
default y if CC_IS_GCC && GCC_VERSION >= 160000
152152

scripts/coccinelle/api/kmalloc_objs.cocci

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,14 @@ fresh identifier ALLOC_OBJS = script:python(ALLOC_ARRAY) { alloc_array(ALLOC_ARR
122122
- ALLOC(struct_size_t(TYPE, FLEX, COUNT), GFP)
123123
+ ALLOC_FLEX(TYPE, FLEX, COUNT, GFP)
124124
)
125+
126+
@drop_gfp_kernel depends on patch && !(file in "tools") && !(file in "samples")@
127+
identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
128+
kzalloc_obj,kzalloc_objs,kzalloc_flex,
129+
kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
130+
kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
131+
@@
132+
133+
ALLOC(...
134+
- , GFP_KERNEL
135+
)

0 commit comments

Comments
 (0)