]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: give every really deep type a unique name
authorKeith Randall <khr@golang.org>
Tue, 7 Jan 2020 01:17:33 +0000 (17:17 -0800)
committerKeith Randall <khr@golang.org>
Wed, 8 Jan 2020 18:43:55 +0000 (18:43 +0000)
commit2248fc63ab53f90020e77df3fbd131a539d68fd4
tree459736069ba17c28d6f8ee74937ebea4a34b49a4
parent77c13021dd401945711ff40f16a5040a075fcef9
cmd/compile: give every really deep type a unique name

This avoids the security problem in #29312 where two very deep, but
distinct, types are given the same name. They both make it to the
linker which chooses one, and the use of the other is now type unsafe.

Instead, give every very deep type its own name. This errs on the
other side, in that very deep types that should be convertible to each
other might now not be. But at least that's not a security hole.

Update #29312.

Change-Id: Iac0ebe73fdc50594fd6fbf7432eef65f9a053126
Reviewed-on: https://go-review.googlesource.com/c/go/+/213517
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/fmt.go
test/fixedbugs/issue29312.go [new file with mode: 0644]