]> git.baikalelectronics.ru Git - kernel.git/commit
net/flow_dissector: correctly cap nhoff and thoff in case of BPF
authorStanislav Fomichev <sdf@google.com>
Thu, 6 Dec 2018 04:40:48 +0000 (20:40 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 7 Dec 2018 21:38:29 +0000 (13:38 -0800)
commitc0f3496d472850e0828965434b088a9d4f66d8ee
treeb4943b459ce0aa731a75f27543b536fc8ba070bd
parentf4b83190a208afa60e6e68de6d3e6b1e7a29b5d4
net/flow_dissector: correctly cap nhoff and thoff in case of BPF

We want to make sure that the following condition holds:
0 <= nhoff <= thoff <= skb->len

BPF program can set out-of-bounds nhoff and thoff, which is dangerous, see
recent commit a9cc13498ccb ("flow_dissector: properly cap thoff field")'.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/core/flow_dissector.c