Skip to content

Commit d2e527f

Browse files
committed
mm/slab: remove HAVE_HARDENED_USERCOPY_ALLOCATOR
With SLOB removed, both remaining allocators support hardened usercopy, so remove the config and associated #ifdef. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
1 parent 8040cbf commit d2e527f

3 files changed

Lines changed: 0 additions & 18 deletions

File tree

mm/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,13 @@ choice
221221
config SLAB
222222
bool "SLAB"
223223
depends on !PREEMPT_RT
224-
select HAVE_HARDENED_USERCOPY_ALLOCATOR
225224
help
226225
The regular slab allocator that is established and known to work
227226
well in all environments. It organizes cache hot objects in
228227
per cpu and per node queues.
229228

230229
config SLUB
231230
bool "SLUB (Unqueued Allocator)"
232-
select HAVE_HARDENED_USERCOPY_ALLOCATOR
233231
help
234232
SLUB is a slab allocator that minimizes cache line usage
235233
instead of managing queues of cached objects (SLAB approach).

mm/slab.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,8 @@ struct kmem_obj_info {
832832
void __kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab);
833833
#endif
834834

835-
#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR
836835
void __check_heap_object(const void *ptr, unsigned long n,
837836
const struct slab *slab, bool to_user);
838-
#else
839-
static inline
840-
void __check_heap_object(const void *ptr, unsigned long n,
841-
const struct slab *slab, bool to_user)
842-
{
843-
}
844-
#endif
845837

846838
#ifdef CONFIG_SLUB_DEBUG
847839
void skip_orig_size_check(struct kmem_cache *s, const void *object);

security/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,8 @@ config LSM_MMAP_MIN_ADDR
127127
this low address space will need the permission specific to the
128128
systems running LSM.
129129

130-
config HAVE_HARDENED_USERCOPY_ALLOCATOR
131-
bool
132-
help
133-
The heap allocator implements __check_heap_object() for
134-
validating memory ranges against heap object sizes in
135-
support of CONFIG_HARDENED_USERCOPY.
136-
137130
config HARDENED_USERCOPY
138131
bool "Harden memory copies between kernel and userspace"
139-
depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
140132
imply STRICT_DEVMEM
141133
help
142134
This option checks for obviously wrong memory regions when

0 commit comments

Comments
 (0)