mbox series

[4.19,0/3] BPF fixes for CVE-2021-3444 and CVE-2021-3600

Message ID 20210827135533.146070-1-cascardo@canonical.com (mailing list archive)
Headers show
Series BPF fixes for CVE-2021-3444 and CVE-2021-3600 | expand

Message

Thadeu Lima de Souza Cascardo Aug. 27, 2021, 1:55 p.m. UTC
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.19.y tree and some tests
specific to the two referred CVEs.

Daniel Borkmann (3):
  bpf: Do not use ax register in interpreter on div/mod
  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      | 32 +++++++++++++++-----------------
 kernel/bpf/verifier.c  | 27 ++++++++++++++-------------
 3 files changed, 53 insertions(+), 30 deletions(-)

Comments

Greg Kroah-Hartman Aug. 27, 2021, 2:38 p.m. UTC | #1
On Fri, Aug 27, 2021 at 10:55:30AM -0300, Thadeu Lima de Souza Cascardo wrote:
> 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.19.y tree and some tests
> specific to the two referred CVEs.

THanks for these, now queued up!

greg k-h