mainlining shenanigans
Go to file
Björn Töpel ff1c08e1f7 bpf: Change size to u64 for bpf_map_{area_alloc, charge_init}()
The functions bpf_map_area_alloc() and bpf_map_charge_init() prior
this commit passed the size parameter as size_t. In this commit this
is changed to u64.

All users of these functions avoid size_t overflows on 32-bit systems,
by explicitly using u64 when calculating the allocation size and
memory charge cost. However, since the result was narrowed by the
size_t when passing size and cost to the functions, the overflow
handling was in vain.

Instead of changing all call sites to size_t and handle overflow at
the call site, the parameter is changed to u64 and checked in the
functions above.

Fixes: d407bd25a2 ("bpf: don't trigger OOM killer under pressure with map alloc")
Fixes: c85d69135a ("bpf: move memory size checks to bpf_map_charge_init()")
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Link: https://lore.kernel.org/bpf/20191029154307.23053-1-bjorn.topel@gmail.com
2019-10-31 21:41:33 +01:00
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-19 17:09:11 -04:00
block
certs
crypto
Documentation Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-19 17:09:11 -04:00
drivers cxgb4: request the TX CIDX updates to status page 2019-10-25 20:20:50 -07:00
fs Merge branch 'akpm' (patches from Andrew) 2019-10-19 06:53:59 -04:00
include bpf: Change size to u64 for bpf_map_{area_alloc, charge_init}() 2019-10-31 21:41:33 +01:00
init
ipc
kernel bpf: Change size to u64 for bpf_map_{area_alloc, charge_init}() 2019-10-31 21:41:33 +01:00
lib copy-struct-from-user-v5.4-rc4 2019-10-18 18:19:04 -04:00
LICENSES
mm mm/thp: allow dropping THP from page cache 2019-10-19 06:32:33 -04:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2019-10-27 12:13:16 -07:00
samples samples/bpf: fix build by setting HAVE_ATTR_TEST to zero 2019-10-31 21:39:15 +01:00
scripts scripts/gdb: fix debugging modules on s390 2019-10-19 06:32:33 -04:00
security
sound ALSA: hda - Force runtime PM on Nvidia HDMI codecs 2019-10-17 17:45:32 +02:00
tools perf tools: Make usage of test_attr__* optional for perf-sys.h 2019-10-31 21:38:41 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS bpf, doc: Add Andrii as official reviewer to BPF subsystem 2019-10-29 15:51:59 +01:00
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.