]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.23] 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:17 +0000 (14:55 +0000)
commit032ac075c20c01c6c35a672d1542d3e98eab84ea
treed2f1cf56c445340eee0adf8764ddf24ff0f9647a
parentfa8ff1a46deb6c816304441ec6740ec112e19012
[release-branch.go1.23] 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 #69149
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/+/1562
Commit-Queue: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/611177
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/go/build/constraint/expr.go
src/go/build/constraint/expr_test.go