Skip to content

BPF fixes for CVE-2021-3444 and CVE-2021-3600

Thadeu Lima de Souza Cascardo bpf stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf: Do not use ax register in interpreter on div/modkernel/bpf/core.c+15 -173 replies
2/4bpf: fix subprog verifier bypass by div/mod by 0 exceptionkernel/bpf/core.c kernel/bpf/verifier.c net/core/filter.c+38 -170 replies
3/4bpf: Fix 32 bit src register truncation on div/modinclude/linux/filter.h kernel/bpf/verifier.c+35 -110 replies
4/4bpf: Fix truncation handling for mod32 dst reg wrt zerokernel/bpf/verifier.c+5 -40 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJohn FastabendAlexei StarovoitovSalvatore Bonaccorso
1/4R-b
2/4A-b
3/4T-b
4/4R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 4.14 0/4] BPF fixes for CVE-2021-3444 and CVE-2021-3600

The upstream changes necessary to fix these CVEs rely on the presence of JMP32, which is not a small backport and brings its own potential set of necessary follow-ups.

Daniel Borkmann, John Fastabend and Alexei Starovoitov came up with a fix involving the use of the AX register.

This has been tested against the test_verifier in 4.14.y tree and some tests specific to the two referred CVEs. The test_bpf module was also tested.

Daniel Borkmann (4):
bpf: Do not use ax register in interpreter on div/mod
bpf: fix subprog verifier bypass by div/mod by 0 exception
bpf: Fix 32 bit src register truncation on div/mod
bpf: Fix truncation handling for mod32 dst reg wrt zero

 include/linux/filter.h | 24 ++++++++++++++++++++++++
 kernel/bpf/core.c      | 40 +++++++++++++++-------------------------
 kernel/bpf/verifier.c  | 39 +++++++++++++++++++++++++++++++--------
 net/core/filter.c      |  9 ++++++++-
 4 files changed, 78 insertions(+), 34 deletions(-)
Signature · 1 line
2.30.2