]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, verifier: reject xadd on flow key memory
authorDaniel Borkmann <daniel@iogearbox.net>
Sun, 21 Oct 2018 00:09:25 +0000 (02:09 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 21 Oct 2018 06:13:32 +0000 (23:13 -0700)
commit5002350c40b6bbfdf9906df11b04888023acf9b9
tree7dc1384f099dc3740d7af361787254cd5c29acdd
parent21ae72c98d2e511c2162b0d1da960fe6308b5718
bpf, verifier: reject xadd on flow key memory

We should not enable xadd operation for flow key memory if not
needed there anyway. There is no such issue as described in the
commit 4aec8970d3f3 ("bpf: reject stores into ctx via st and xadd")
since there's no context rewriter for flow keys today, but it
also shouldn't become part of the user facing behavior to allow
for it. After patch:

  0: (79) r7 = *(u64 *)(r1 +144)
  1: (b7) r3 = 4096
  2: (db) lock *(u64 *)(r7 +0) += r3
  BPF_XADD stores into R7 flow_keys is not allowed

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c