diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-07-14 18:45:49 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-02 18:47:01 +0200 |
commit | 7661809d493b426e979f39ab512e3adf41fbcc69 (patch) | |
tree | e6aefba9862580081aee2c8538676a4637d54d20 /init | |
parent | Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/t... (diff) | |
download | linux-7661809d493b426e979f39ab512e3adf41fbcc69.tar.xz linux-7661809d493b426e979f39ab512e3adf41fbcc69.zip |
mm: don't allow oversized kvmalloc() calls
'kvmalloc()' is a convenience function for people who want to do a
kmalloc() but fall back on vmalloc() if there aren't enough physically
contiguous pages, or if the allocation is larger than what kmalloc()
supports.
However, let's make sure it doesn't get _too_ easy to do crazy things
with it. In particular, don't allow big allocations that could be due
to integer overflow or underflow. So make sure the allocation size fits
in an 'int', to protect against trivial integer conversion issues.
Acked-by: Willy Tarreau <w@1wt.eu>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions