]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] go/build/constraint: add parsing limits
authorRoland Shoemaker <bracewell@google.com>
Thu, 20 Jun 2024 17:45:30 +0000 (10:45 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 5 Sep 2024 14:55:24 +0000 (14:55 +0000)
commitd4c53812e6ce2ac368173d7fcd31d0ecfcffb002
tree2c22007c0ae7aa5a90d3587471ec77f4fb42f4f5
parent2092294f2b097c5828f4eace6c98a322c1510b01
[release-branch.go1.22] go/build/constraint: add parsing limits

Limit the size of build constraints that we will parse. This prevents a
number of stack exhaustions that can be hit when parsing overly complex
constraints. The imposed limits are unlikely to ever be hit in real
world usage.

Updates #69141
Fixes #69148
Fixes CVE-2024-34158

Change-Id: I38b614bf04caa36eefc6a4350d848588c4cef3c4
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1540
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Russ Cox <rsc@google.com>
(cherry picked from commit 0c74dc9e0da0cf1e12494b514d822b5bebbc9f04)
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1582
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/611183
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
src/go/build/constraint/expr.go
src/go/build/constraint/expr_test.go