Merge branch 'bpf-romap-known-scalars'
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Oct 2019 23:49:16 +0000 (01:49 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Oct 2019 23:49:21 +0000 (01:49 +0200)
commit63098555cfe09a633b74a3c9963769c6d4df8432
tree59d859c0324f8da7eea026033a3ccd8ffec63b05
parente0b68fb186b251374adbd870f99b1ecea236e770
parent666b2c10ee9d51f14d04c416a14b1cb6fd0846e4
Merge branch 'bpf-romap-known-scalars'

Andrii Nakryiko says:

====================
With BPF maps supporting direct map access (currently, array_map w/ single
element, used for global data) that are read-only both from system call and
BPF side, it's possible for BPF verifier to track its contents as known
constants.

Now it's possible for user-space control app to pre-initialize read-only map
(e.g., for .rodata section) with user-provided flags and parameters and rely
on BPF verifier to detect and eliminate dead code resulting from specific
combination of input parameters.

v1->v2:
- BPF_F_RDONLY means nothing, stick to just map->frozen (Daniel);
- stick to passing just offset into map_direct_value_addr (Martin).
====================

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>