From: Katie Hockman Date: Tue, 10 Nov 2020 20:54:12 +0000 (-0500) Subject: math/big: fix shift for recursive division X-Git-Tag: go1.16beta1~242 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1e1fa5903b;p=gostls13.git math/big: fix shift for recursive division The previous s value could cause a crash for certain inputs. Will check in tests and documentation improvements later. Thanks to the Go Ethereum team and the OSS-Fuzz project for reporting this. Thanks to Rémy Oudompheng and Robert Griesemer for their help developing and validating the fix. Fixes CVE-2020-28362 Change-Id: Ibbf455c4436bcdb07c84a34fa6551fb3422356d3 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/899974 Reviewed-by: Roland Shoemaker Reviewed-by: Filippo Valsorda Reviewed-on: https://go-review.googlesource.com/c/go/+/269657 Trust: Katie Hockman Trust: Roland Shoemaker Run-TryBot: Katie Hockman Reviewed-by: Roland Shoemaker TryBot-Result: Go Bot --- diff --git a/src/math/big/nat.go b/src/math/big/nat.go index c2f3787848..068176e1c1 100644 --- a/src/math/big/nat.go +++ b/src/math/big/nat.go @@ -929,7 +929,7 @@ func (z nat) divRecursiveStep(u, v nat, depth int, tmp *nat, temps []*nat) { // Now u < (v<