Skip to content

Commit 2632bb8

Browse files
committed
mm: Remove unused vm_brk()
With fs/binfmt_elf.c fully refactored to use the new elf_load() helper, there are no more users of vm_brk(), so remove it. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Suggested-by: Eric Biederman <ebiederm@xmission.com> Tested-by: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Sebastian Ott <sebott@redhat.com> Link: https://lore.kernel.org/r/20230929032435.2391507-6-keescook@chromium.org Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent f9c0a39 commit 2632bb8

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

include/linux/mm.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,8 +3308,7 @@ static inline void mm_populate(unsigned long addr, unsigned long len)
33083308
static inline void mm_populate(unsigned long addr, unsigned long len) {}
33093309
#endif
33103310

3311-
/* These take the mm semaphore themselves */
3312-
extern int __must_check vm_brk(unsigned long, unsigned long);
3311+
/* This takes the mm semaphore itself */
33133312
extern int __must_check vm_brk_flags(unsigned long, unsigned long, unsigned long);
33143313
extern int vm_munmap(unsigned long, size_t);
33153314
extern unsigned long __must_check vm_mmap(struct file *, unsigned long,

mm/mmap.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,12 +3174,6 @@ int vm_brk_flags(unsigned long addr, unsigned long request, unsigned long flags)
31743174
}
31753175
EXPORT_SYMBOL(vm_brk_flags);
31763176

3177-
int vm_brk(unsigned long addr, unsigned long len)
3178-
{
3179-
return vm_brk_flags(addr, len, 0);
3180-
}
3181-
EXPORT_SYMBOL(vm_brk);
3182-
31833177
/* Release all mmaps. */
31843178
void exit_mmap(struct mm_struct *mm)
31853179
{

mm/nommu.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,11 +1531,6 @@ void exit_mmap(struct mm_struct *mm)
15311531
mmap_write_unlock(mm);
15321532
}
15331533

1534-
int vm_brk(unsigned long addr, unsigned long len)
1535-
{
1536-
return -ENOMEM;
1537-
}
1538-
15391534
/*
15401535
* expand (or shrink) an existing mapping, potentially moving it at the same
15411536
* time (controlled by the MREMAP_MAYMOVE flag and available VM space)

0 commit comments

Comments
 (0)