]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: relax inode permission check for retrieving bpf program
authorChenbo Feng <fengc@google.com>
Wed, 15 May 2019 02:42:57 +0000 (19:42 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 16 May 2019 18:31:49 +0000 (11:31 -0700)
commit409e6eea9c6372e9d97e477972a5d3da0f3b2821
tree57ee781efe7e061b8a8a822c80744f2b4c37a40b
parent1cae267f76a28226e6d651207b876293b58a7a0f
bpf: relax inode permission check for retrieving bpf program

For iptable module to load a bpf program from a pinned location, it
only retrieve a loaded program and cannot change the program content so
requiring a write permission for it might not be necessary.
Also when adding or removing an unrelated iptable rule, it might need to
flush and reload the xt_bpf related rules as well and triggers the inode
permission check. It might be better to remove the write premission
check for the inode so we won't need to grant write access to all the
processes that flush and restore iptables rules.

Signed-off-by: Chenbo Feng <fengc@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/inode.c