From 813c9523a92fbc8e6c3cf1e17de78f2d7ab905a5 Mon Sep 17 00:00:00 2001
From: shaquilleq
- TODO: https://golang.org/cl/215001: do not remove trailing zeros for %g and %G with #(sharp) flag
+ The printing verbs
From fca286bed3ed0e12336532cc711875ae5b3cb02a Mon Sep 17 00:00:00 2001
From: Carlos Amedee %#g and %#G now preserve
+ trailing zeros for floating-point values.
-TODO -
-
From acdd111e320363c77eb04a761f0b7d4a9dd64c22 Mon Sep 17 00:00:00 2001
From: Austin Clements
+ The -race and -msan flags now always
+ enable -d=checkptr, which checks uses
+ of unsafe.Pointer. This was previously the case on all
+ OSes except Windows.
+
Go-built DLLs no longer cause the process to exit when it receives a signal (such as Ctrl-C at a terminal). @@ -245,6 +252,15 @@ TODO aggressively eliminating unused type metadata.
+
+ The toolchain now mitigates
+ Intel
+ CPU erratum SKX102 on GOARCH=amd64 by aligning
+ functions to 32 byte boundaries and padding jump instructions. While
+ this padding increases binary sizes, this is more than made up for
+ by the binary size improvements mentioned above.
+
Go 1.15 adds a -spectre flag to both the
compiler and the assembler, to allow enabling Spectre mitigations.
@@ -253,6 +269,19 @@ TODO
See the Spectre wiki page for details.
+ The compiler now rejects //go: compiler directives that
+ have no meaning for the declaration they are applied to with a
+ "misplaced compiler directive" error. Such misapplied directives
+ were broken before, but were silently ignored by the compiler.
+
+ The compiler's -json optimization logging now reports
+ large (>= 128 byte) copies and includes explanations of escape
+ analysis decisions.
+
@@ -283,6 +312,14 @@ TODO improvements expected in future releases.
+
+ The objdump tool now supports
+ disassembling in GNU assembler syntax with the -gnu
+ flag.
+
- Go now retries system calls that return EINTR. This
- became more common in Go 1.14 with the addition of asynchronous
- preemption, but is now handled transparently.
+
+ If panic is invoked with a value whose type is derived from any
+ of: bool, complex64, complex128, float32, float64,
+ int, int8, int16, int32, int64, string,
+ uint, uint8, uint16, uint32, uint64, uintptr,
+ then the value will be printed, instead of just its address.
+ Previously, this was only true for values of exactly these types.
+
+ On a Unix system, if the kill command
+ or kill system call is used to send
+ a SIGSEGV, SIGBUS,
+ or SIGFPE signal to a Go program, and if the signal
+ is not being handled via
+ os/signal.Notify,
+ the Go program will now reliably crash with a stack trace.
+ In earlier releases the behavior was unpredictable.
@@ -229,8 +243,14 @@ Do not send CLs removing the interior tags from such phrases. counts, and has lower worst-case latency.
--TODO +
+ Converting a small integer value into an interface value no longer + causes allocation. +
+ ++ Non-blocking receives on closed channels now perform as well as + non-blocking receives on open channels.
Timeout returns true although a
deadline has not been exceeded.
+
+
+ Packages os and net now automatically
+ retry system calls that fail with EINTR. Previously
+ this led to spurious failures, which became more common in Go
+ 1.14 with the addition of asynchronous preemption. Now this is
+ handled transparently.
+
- Package reflect now disallows accessing methods of all
+ Package reflect now disallows accessing methods of all
non-exported fields, whereas previously it allowed accessing
those of non-exported, embedded fields. Code that relies on the
previous behavior should be updated to instead access the
@@ -580,26 +608,6 @@ TODO
- If panic is invoked with a value whose type is derived from any
- of: bool, complex64, complex128, float32, float64,
- int, int8, int16, int32, int64, string,
- uint, uint8, uint16, uint32, uint64, uintptr,
- then the value will be printed, instead of just its address.
- Previously, this was only true for values of exactly these types.
-
- On a Unix system, if the kill command
- or kill system call is used to send
- a SIGSEGV, SIGBUS,
- or SIGFPE signal to a Go program, and if the signal
- is not being handled via
- os/signal.Notify,
- the Go program will now reliably crash with a stack trace.
- In earlier releases the behavior was unpredictable.
-
Several functions, including
ReadMemStats
@@ -607,16 +615,6 @@ TODO
GoroutineProfile,
no longer block if a garbage collection is in progress.
- Converting small integer values into an interface value no - longer causes allocation. -
- -- Non-blocking receives on closed channels now perform as well as - non-blocking receives on open channels. -
invalid
flag errors in code that built successfully with older
releases.
@@ -267,7 +267,7 @@ and the test2json documentation.
Options specified by cgo using #cgo CFLAGS and the like
-are now checked against a whitelist of permitted options.
+are now checked against an allowlist of permitted options.
This closes a security hole in which a downloaded package uses
compiler options like
-fplugin
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index 4366df4b55..ca18c45d9d 100644
--- a/src/cmd/cgo/doc.go
+++ b/src/cmd/cgo/doc.go
@@ -990,7 +990,7 @@ produces a file named a.out, even if cmd/link does so by invoking the host
linker in external linking mode.
By default, cmd/link will decide the linking mode as follows: if the only
-packages using cgo are those on a whitelist of standard library
+packages using cgo are those on a list of known standard library
packages (net, os/user, runtime/cgo), cmd/link will use internal linking
mode. Otherwise, there are non-standard cgo packages involved, and cmd/link
will use external linking mode. The first rule means that a build of
diff --git a/src/cmd/compile/fmt_test.go b/src/cmd/compile/fmt_test.go
index f1af6473c7..768ca7fc89 100644
--- a/src/cmd/compile/fmt_test.go
+++ b/src/cmd/compile/fmt_test.go
@@ -96,7 +96,7 @@ func TestFormats(t *testing.T) {
}
importPath := filepath.Join("cmd/compile", path)
- if blacklistedPackages[filepath.ToSlash(importPath)] {
+ if blocklistedPackages[filepath.ToSlash(importPath)] {
return filepath.SkipDir
}
@@ -344,8 +344,8 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
for index, file := range files {
ast.Inspect(file, func(n ast.Node) bool {
if call, ok := n.(*ast.CallExpr); ok {
- // ignore blacklisted functions
- if blacklistedFunctions[nodeString(call.Fun)] {
+ // ignore blocklisted functions
+ if blocklistedFunctions[nodeString(call.Fun)] {
return true
}
// look for an arguments that might be a format string
@@ -354,7 +354,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
// make sure we have enough arguments
n := numFormatArgs(s)
if i+1+n > len(call.Args) {
- t.Errorf("%s: not enough format args (blacklist %s?)", posString(call), nodeString(call.Fun))
+ t.Errorf("%s: not enough format args (blocklist %s?)", posString(call), nodeString(call.Fun))
break // ignore this call
}
// assume last n arguments are to be formatted;
@@ -549,14 +549,14 @@ func formatReplace(in string, f func(i int, s string) string) string {
return string(append(buf, in[i0:]...))
}
-// blacklistedPackages is the set of packages which can
+// blocklistedPackages is the set of packages which can
// be ignored.
-var blacklistedPackages = map[string]bool{}
+var blocklistedPackages = map[string]bool{}
-// blacklistedFunctions is the set of functions which may have
+// blocklistedFunctions is the set of functions which may have
// format-like arguments but which don't do any formatting and
// thus may be ignored.
-var blacklistedFunctions = map[string]bool{}
+var blocklistedFunctions = map[string]bool{}
func init() {
// verify that knownFormats entries are correctly formatted
diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go
index 8e781a7997..f3e9ab78ef 100644
--- a/src/cmd/compile/internal/gc/esc.go
+++ b/src/cmd/compile/internal/gc/esc.go
@@ -141,13 +141,13 @@ func isSelfAssign(dst, src *Node) bool {
return samesafeexpr(dst.Left, src.Left)
}
-// mayAffectMemory reports whether n evaluation may affect program memory state.
-// If expression can't affect it, then it can be safely ignored by the escape analysis.
+// mayAffectMemory reports whether evaluation of n may affect the program's
+// memory state. If the expression can't affect memory state, then it can be
+// safely ignored by the escape analysis.
func mayAffectMemory(n *Node) bool {
- // We may want to use "memory safe" black list instead of general
- // "side-effect free", which can include all calls and other ops
- // that can affect allocate or change global state.
- // It's safer to start from a whitelist for now.
+ // We may want to use a list of "memory safe" ops instead of generally
+ // "side-effect free", which would include all calls and other ops that can
+ // allocate or change global state. For now, it's safer to start with the latter.
//
// We're ignoring things like division by zero, index out of range,
// and nil pointer dereference here.
diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go
index 318d688d2e..9a4fdcda5f 100644
--- a/src/cmd/go/internal/work/gc.go
+++ b/src/cmd/go/internal/work/gc.go
@@ -168,7 +168,7 @@ func gcBackendConcurrency(gcflags []string) int {
CheckFlags:
for _, flag := range gcflags {
// Concurrent compilation is presumed incompatible with any gcflags,
- // except for a small whitelist of commonly used flags.
+ // except for a small allowlist of commonly used flags.
// If the user knows better, they can manually add their own -c to the gcflags.
switch flag {
case "-N", "-l", "-S", "-B", "-C", "-I":
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go
index ab38bc3f5c..b871f664ea 100644
--- a/src/cmd/link/internal/loader/loader.go
+++ b/src/cmd/link/internal/loader/loader.go
@@ -634,15 +634,15 @@ func (l *Loader) checkdup(name string, r *oReader, li int, dup Sym) {
}
fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.unit.Lib, name, rdup.unit.Lib, reason)
- // For the moment, whitelist DWARF subprogram DIEs for
+ // For the moment, allowlist DWARF subprogram DIEs for
// auto-generated wrapper functions. What seems to happen
// here is that we get different line numbers on formal
// params; I am guessing that the pos is being inherited
// from the spot where the wrapper is needed.
- whitelist := strings.HasPrefix(name, "go.info.go.interface") ||
+ allowlist := strings.HasPrefix(name, "go.info.go.interface") ||
strings.HasPrefix(name, "go.info.go.builtin") ||
strings.HasPrefix(name, "go.debuglines")
- if !whitelist {
+ if !allowlist {
l.strictDupMsgs++
}
}
diff --git a/src/cmd/oldlink/internal/objfile/objfile.go b/src/cmd/oldlink/internal/objfile/objfile.go
index 6882b7694b..ae28e9673a 100644
--- a/src/cmd/oldlink/internal/objfile/objfile.go
+++ b/src/cmd/oldlink/internal/objfile/objfile.go
@@ -411,16 +411,16 @@ overwrite:
}
fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.lib, dup, dup.Unit.Lib, reason)
- // For the moment, whitelist DWARF subprogram DIEs for
+ // For the moment, allowlist DWARF subprogram DIEs for
// auto-generated wrapper functions. What seems to happen
// here is that we get different line numbers on formal
// params; I am guessing that the pos is being inherited
// from the spot where the wrapper is needed.
- whitelist := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
+ allowlist := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
strings.HasPrefix(dup.Name, "go.info.go.builtin") ||
strings.HasPrefix(dup.Name, "go.isstmt.go.builtin") ||
strings.HasPrefix(dup.Name, "go.debuglines"))
- if !whitelist {
+ if !allowlist {
r.strictDupMsgs++
}
}
diff --git a/src/html/template/html.go b/src/html/template/html.go
index 13a0cd0436..d3359cac0a 100644
--- a/src/html/template/html.go
+++ b/src/html/template/html.go
@@ -240,7 +240,7 @@ func htmlNameFilter(args ...interface{}) string {
}
s = strings.ToLower(s)
if t := attrType(s); t != contentTypePlain {
- // TODO: Split attr and element name part filters so we can whitelist
+ // TODO: Split attr and element name part filters so we can allowlist
// attributes.
return filterFailsafe
}
diff --git a/src/net/http/request.go b/src/net/http/request.go
index e924e2a07f..e4a00dd569 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -503,7 +503,7 @@ func valueOrDefault(value, def string) string {
// NOTE: This is not intended to reflect the actual Go version being used.
// It was changed at the time of Go 1.1 release because the former User-Agent
-// had ended up on a blacklist for some intrusion detection systems.
+// had ended up on a blocklist for some intrusion detection systems.
// See https://codereview.appspot.com/7532043.
const defaultUserAgent = "Go-http-client/1.1"
diff --git a/src/net/http/server.go b/src/net/http/server.go
index b613c21f16..a75dd1461f 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -1698,8 +1698,8 @@ func (c *conn) closeWriteAndWait() {
time.Sleep(rstAvoidanceDelay)
}
-// validNextProto reports whether the proto is not a blacklisted ALPN
-// protocol name. Empty and built-in protocol types are blacklisted
+// validNextProto reports whether the proto is not a blocklisted ALPN
+// protocol name. Empty and built-in protocol types are blocklisted
// and can't be overridden with alternate implementations.
func validNextProto(proto string) bool {
switch proto {
diff --git a/src/os/signal/internal/pty/pty.go b/src/os/signal/internal/pty/pty.go
index fb3ee1ea7a..f8813ce6be 100644
--- a/src/os/signal/internal/pty/pty.go
+++ b/src/os/signal/internal/pty/pty.go
@@ -40,8 +40,8 @@ func (e *PtyError) Error() string {
func (e *PtyError) Unwrap() error { return e.Errno }
-// Open returns a master pty and the name of the linked slave tty.
-func Open() (master *os.File, slave string, err error) {
+// Open returns a control pty and the name of the linked process tty.
+func Open() (pty *os.File, processTTY string, err error) {
m, err := C.posix_openpt(C.O_RDWR)
if err != nil {
return nil, "", ptyError("posix_openpt", err)
@@ -54,6 +54,6 @@ func Open() (master *os.File, slave string, err error) {
C.close(m)
return nil, "", ptyError("unlockpt", err)
}
- slave = C.GoString(C.ptsname(m))
- return os.NewFile(uintptr(m), "pty-master"), slave, nil
+ processTTY = C.GoString(C.ptsname(m))
+ return os.NewFile(uintptr(m), "pty"), processTTY, nil
}
diff --git a/src/os/signal/signal_cgo_test.go b/src/os/signal/signal_cgo_test.go
index 849a96ec0e..a117221400 100644
--- a/src/os/signal/signal_cgo_test.go
+++ b/src/os/signal/signal_cgo_test.go
@@ -19,7 +19,7 @@ import (
"io"
"os"
"os/exec"
- "os/signal/internal/pty"
+ ptypkg "os/signal/internal/pty"
"strconv"
"strings"
"sync"
@@ -71,20 +71,20 @@ func TestTerminalSignal(t *testing.T) {
// The test only fails when using a "slow device," in this
// case a pseudo-terminal.
- master, sname, err := pty.Open()
+ pty, procTTYName, err := ptypkg.Open()
if err != nil {
- ptyErr := err.(*pty.PtyError)
+ ptyErr := err.(*ptypkg.PtyError)
if ptyErr.FuncName == "posix_openpt" && ptyErr.Errno == syscall.EACCES {
t.Skip("posix_openpt failed with EACCES, assuming chroot and skipping")
}
t.Fatal(err)
}
- defer master.Close()
- slave, err := os.OpenFile(sname, os.O_RDWR, 0)
+ defer pty.Close()
+ procTTY, err := os.OpenFile(procTTYName, os.O_RDWR, 0)
if err != nil {
t.Fatal(err)
}
- defer slave.Close()
+ defer procTTY.Close()
// Start an interactive shell.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
@@ -92,9 +92,9 @@ func TestTerminalSignal(t *testing.T) {
cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i")
// Clear HISTFILE so that we don't read or clobber the user's bash history.
cmd.Env = append(os.Environ(), "HISTFILE=")
- cmd.Stdin = slave
- cmd.Stdout = slave
- cmd.Stderr = slave
+ cmd.Stdin = procTTY
+ cmd.Stdout = procTTY
+ cmd.Stderr = procTTY
cmd.SysProcAttr = &syscall.SysProcAttr{
Setsid: true,
Setctty: true,
@@ -105,21 +105,21 @@ func TestTerminalSignal(t *testing.T) {
t.Fatal(err)
}
- if err := slave.Close(); err != nil {
- t.Errorf("closing slave: %v", err)
+ if err := procTTY.Close(); err != nil {
+ t.Errorf("closing procTTY: %v", err)
}
progReady := make(chan bool)
sawPrompt := make(chan bool, 10)
const prompt = "prompt> "
- // Read data from master in the background.
+ // Read data from pty in the background.
var wg sync.WaitGroup
wg.Add(1)
defer wg.Wait()
go func() {
defer wg.Done()
- input := bufio.NewReader(master)
+ input := bufio.NewReader(pty)
var line, handled []byte
for {
b, err := input.ReadByte()
@@ -130,11 +130,11 @@ func TestTerminalSignal(t *testing.T) {
if perr, ok := err.(*os.PathError); ok {
err = perr.Err
}
- // EOF means master is closed.
+ // EOF means pty is closed.
// EIO means child process is done.
- // "file already closed" means deferred close of master has happened.
+ // "file already closed" means deferred close of pty has happened.
if err != io.EOF && err != syscall.EIO && !strings.Contains(err.Error(), "file already closed") {
- t.Logf("error reading from master: %v", err)
+ t.Logf("error reading from pty: %v", err)
}
return
}
@@ -161,7 +161,7 @@ func TestTerminalSignal(t *testing.T) {
}()
// Set the bash prompt so that we can see it.
- if _, err := master.Write([]byte("PS1='" + prompt + "'\n")); err != nil {
+ if _, err := pty.Write([]byte("PS1='" + prompt + "'\n")); err != nil {
t.Fatalf("setting prompt: %v", err)
}
select {
@@ -172,7 +172,7 @@ func TestTerminalSignal(t *testing.T) {
// Start a small program that reads from stdin
// (namely the code at the top of this function).
- if _, err := master.Write([]byte("GO_TEST_TERMINAL_SIGNALS=1 " + os.Args[0] + " -test.run=TestTerminalSignal\n")); err != nil {
+ if _, err := pty.Write([]byte("GO_TEST_TERMINAL_SIGNALS=1 " + os.Args[0] + " -test.run=TestTerminalSignal\n")); err != nil {
t.Fatal(err)
}
@@ -190,7 +190,7 @@ func TestTerminalSignal(t *testing.T) {
time.Sleep(pause)
// Send a ^Z to stop the program.
- if _, err := master.Write([]byte{26}); err != nil {
+ if _, err := pty.Write([]byte{26}); err != nil {
t.Fatalf("writing ^Z to pty: %v", err)
}
@@ -202,7 +202,7 @@ func TestTerminalSignal(t *testing.T) {
}
// Restart the stopped program.
- if _, err := master.Write([]byte("fg\n")); err != nil {
+ if _, err := pty.Write([]byte("fg\n")); err != nil {
t.Fatalf("writing %q to pty: %v", "fg", err)
}
@@ -217,7 +217,7 @@ func TestTerminalSignal(t *testing.T) {
// Write some data for the program to read,
// which should cause it to exit.
- if _, err := master.Write([]byte{'\n'}); err != nil {
+ if _, err := pty.Write([]byte{'\n'}); err != nil {
t.Fatalf("writing %q to pty: %v", "\n", err)
}
@@ -229,7 +229,7 @@ func TestTerminalSignal(t *testing.T) {
}
// Exit the shell with the program's exit status.
- if _, err := master.Write([]byte("exit $?\n")); err != nil {
+ if _, err := pty.Write([]byte("exit $?\n")); err != nil {
t.Fatalf("writing %q to pty: %v", "exit", err)
}
diff --git a/src/runtime/cgo_sigaction.go b/src/runtime/cgo_sigaction.go
index bc5e0786d9..967b8b9a0d 100644
--- a/src/runtime/cgo_sigaction.go
+++ b/src/runtime/cgo_sigaction.go
@@ -18,7 +18,7 @@ var _cgo_sigaction unsafe.Pointer
//go:nosplit
//go:nowritebarrierrec
func sigaction(sig uint32, new, old *sigactiont) {
- // The runtime package is explicitly blacklisted from sanitizer
+ // The runtime package is explicitly blocklisted from sanitizer
// instrumentation in racewalk.go, but we might be calling into instrumented C
// functions here — so we need the pointer parameters to be properly marked.
//
diff --git a/src/runtime/debugcall.go b/src/runtime/debugcall.go
index 5cbe382ce7..496e6ce8cc 100644
--- a/src/runtime/debugcall.go
+++ b/src/runtime/debugcall.go
@@ -61,7 +61,7 @@ func debugCallCheck(pc uintptr) string {
"debugCall16384",
"debugCall32768",
"debugCall65536":
- // These functions are whitelisted so that the debugger can initiate multiple function calls.
+ // These functions are allowlisted so that the debugger can initiate multiple function calls.
// See: https://golang.org/cl/161137/
return
}
From 5c6b2b14db8264a8cdc3634e68c7ae65307df0ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=AD?=
+ Decoding a JSON array into a slice no longer reuses any existing slice elements, + following the rules that the package documentation already stated. +
+ ++ Introduce an internal limit to the maximum depth of nesting when decoding. + This reduces the possibility that a deeply nested input could use large quantities + of stack memory, or even cause a "goroutine stack exceeds limit" panic. +
+
From ee379d2b08ce12c24042da18d711e2a1bd7943f0 Mon Sep 17 00:00:00 2001
From: Dmitri Shuralyov DialContext
method permits using a context to both connect and handshake with a TLS server.
+ The new
+ VerifyConnection
+ callback on the Config type
+ allows custom verification logic for every connection. It has access to the
+ ConnectionState
+ which includes peer certificates, SCTs, and stapled OCSP responses.
+
+ Auto-generated session ticket keys are now automatically rotated every 24 hours, + with a lifetime of 7 days, to limit their impact on forward secrecy. +
+ If either the name on the certificate or the name being verified (with
+ VerifyOptions.DNSName
+ or VerifyHostname)
+ are invalid, they will now be compared case-insensitively without further
+ processing (without honoring wildcards or stripping trailing dots).
+ Invalid names include those with any characters other than letters,
+ digits, hyphens and underscores, those with empty labels, and names on
+ certificates with trailing dots.
+
+ The deprecated, legacy behavior of treating the CommonName
+ field as a hostname when no Subject Alternative Names are present is now
+ disabled by default. It can be temporarily re-enabled by adding the value
+ x509ignoreCN=0 to the GODEBUG environment
+ variable. If the CommonName is an invalid hostname, it's
+ always ignored.
+
+ The new CreateRevocationList
+ function and RevocationList type
+ allow creating RFC 5280-compliant X.509 v2 Certificate Revocation Lists.
+
+ CreateCertificate
+ now automatically generates the SubjectKeyId if the template
+ is a CA and doesn't explicitly specify one.
+
+ CreateCertificate
+ now returns an error if the template specifies MaxPathLen but is not a CA.
+
- TODO: https://golang.org/cl/205237: load roots from colon separated SSL_CERT_DIR in loadSystemRoots
+ On Unix systems other than macOS, the SSL_CERT_DIR
+ environment variable can now be a colon-separated list.
+
+ On macOS, binaries are now always linked against
+ Security.framework to extract the system trust roots,
+ regardless of whether cgo is available. The resulting behavior should be
+ more consistent with the OS verifier.
+ The PrivateKey and PublicKey types in the
+ crypto/rsa,
+ crypto/ecdsa, and
+ crypto/ed25519 packages
+ now have an Equal method to compare keys for equivalence
+ or to make type-safe interfaces for public keys. The method signature
+ is compatible with
+ go-cmp's
+ definition of equality.
+
+ Hash now implements
+ fmt.Stringer.
+
+ The new SignASN1
+ and VerifyASN1
+ functions allow generating and verifying ECDSA signatures in the standard
+ ASN.1 DER encoding.
+
+ The new MarshalCompressed
+ and UnmarshalCompressed
+ functions allow encoding and decoding NIST elliptic curve points in compressed format.
+
- VerifyPKCS1v15 now rejects invalid short signatures with missing leading zeroes.
+ VerifyPKCS1v15
+ now rejects invalid short signatures with missing leading zeroes, according to RFC 8017.
+ Name.String
+ now prints non-standard attributes from
+ Names if
+ ExtraNames is empty.
+
@@ -538,7 +592,8 @@ TODO
- TODO: https://golang.org/cl/230397: add (*Int).FillBytes
+ The new Int.FillBytes
+ method allows serializing to fixed-size pre-allocated byte slices.
+ Session ticket lifetimes in TLS 1.2 and earlier, where the session keys + are reused for resumed connections, are now limited to 7 days, also to + limit their impact on forward secrecy. +
+ ++ The client-side downgrade protection checks specified in RFC 8446 are now + enforced. This has the potential to cause connection errors for clients + encountering middleboxes that behave like unauthorized downgrade attacks. +
+ +
+ SignatureScheme,
+ CurveID, and
+ ClientAuthType
+ now implement fmt.Stringer.
+
Options specified by cgo using #cgo CFLAGS and the like
-are now checked against an allowlist of permitted options.
+are now checked against a list of permitted options.
This closes a security hole in which a downloaded package uses
compiler options like
-fplugin
diff --git a/src/cmd/compile/fmt_test.go b/src/cmd/compile/fmt_test.go
index 768ca7fc89..e372259c78 100644
--- a/src/cmd/compile/fmt_test.go
+++ b/src/cmd/compile/fmt_test.go
@@ -96,7 +96,7 @@ func TestFormats(t *testing.T) {
}
importPath := filepath.Join("cmd/compile", path)
- if blocklistedPackages[filepath.ToSlash(importPath)] {
+ if ignoredPackages[filepath.ToSlash(importPath)] {
return filepath.SkipDir
}
@@ -344,8 +344,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
for index, file := range files {
ast.Inspect(file, func(n ast.Node) bool {
if call, ok := n.(*ast.CallExpr); ok {
- // ignore blocklisted functions
- if blocklistedFunctions[nodeString(call.Fun)] {
+ if ignoredFunctions[nodeString(call.Fun)] {
return true
}
// look for an arguments that might be a format string
@@ -354,7 +353,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
// make sure we have enough arguments
n := numFormatArgs(s)
if i+1+n > len(call.Args) {
- t.Errorf("%s: not enough format args (blocklist %s?)", posString(call), nodeString(call.Fun))
+ t.Errorf("%s: not enough format args (ignore %s?)", posString(call), nodeString(call.Fun))
break // ignore this call
}
// assume last n arguments are to be formatted;
@@ -549,14 +548,14 @@ func formatReplace(in string, f func(i int, s string) string) string {
return string(append(buf, in[i0:]...))
}
-// blocklistedPackages is the set of packages which can
+// ignoredPackages is the set of packages which can
// be ignored.
-var blocklistedPackages = map[string]bool{}
+var ignoredPackages = map[string]bool{}
-// blocklistedFunctions is the set of functions which may have
+// ignoredFunctions is the set of functions which may have
// format-like arguments but which don't do any formatting and
// thus may be ignored.
-var blocklistedFunctions = map[string]bool{}
+var ignoredFunctions = map[string]bool{}
func init() {
// verify that knownFormats entries are correctly formatted
diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go
index 9a4fdcda5f..f1d08e0268 100644
--- a/src/cmd/go/internal/work/gc.go
+++ b/src/cmd/go/internal/work/gc.go
@@ -168,7 +168,7 @@ func gcBackendConcurrency(gcflags []string) int {
CheckFlags:
for _, flag := range gcflags {
// Concurrent compilation is presumed incompatible with any gcflags,
- // except for a small allowlist of commonly used flags.
+ // except for known commonly used flags.
// If the user knows better, they can manually add their own -c to the gcflags.
switch flag {
case "-N", "-l", "-S", "-B", "-C", "-I":
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go
index b871f664ea..32c342e545 100644
--- a/src/cmd/link/internal/loader/loader.go
+++ b/src/cmd/link/internal/loader/loader.go
@@ -634,15 +634,15 @@ func (l *Loader) checkdup(name string, r *oReader, li int, dup Sym) {
}
fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.unit.Lib, name, rdup.unit.Lib, reason)
- // For the moment, allowlist DWARF subprogram DIEs for
+ // For the moment, allow DWARF subprogram DIEs for
// auto-generated wrapper functions. What seems to happen
// here is that we get different line numbers on formal
// params; I am guessing that the pos is being inherited
// from the spot where the wrapper is needed.
- allowlist := strings.HasPrefix(name, "go.info.go.interface") ||
+ allowed := strings.HasPrefix(name, "go.info.go.interface") ||
strings.HasPrefix(name, "go.info.go.builtin") ||
strings.HasPrefix(name, "go.debuglines")
- if !allowlist {
+ if !allowed {
l.strictDupMsgs++
}
}
diff --git a/src/cmd/oldlink/internal/objfile/objfile.go b/src/cmd/oldlink/internal/objfile/objfile.go
index ae28e9673a..fbd7eb740b 100644
--- a/src/cmd/oldlink/internal/objfile/objfile.go
+++ b/src/cmd/oldlink/internal/objfile/objfile.go
@@ -411,16 +411,16 @@ overwrite:
}
fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.lib, dup, dup.Unit.Lib, reason)
- // For the moment, allowlist DWARF subprogram DIEs for
+ // For the moment, allow DWARF subprogram DIEs for
// auto-generated wrapper functions. What seems to happen
// here is that we get different line numbers on formal
// params; I am guessing that the pos is being inherited
// from the spot where the wrapper is needed.
- allowlist := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
+ allowed := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
strings.HasPrefix(dup.Name, "go.info.go.builtin") ||
strings.HasPrefix(dup.Name, "go.isstmt.go.builtin") ||
strings.HasPrefix(dup.Name, "go.debuglines"))
- if !allowlist {
+ if !allowed {
r.strictDupMsgs++
}
}
diff --git a/src/html/template/html.go b/src/html/template/html.go
index d3359cac0a..356b8298ae 100644
--- a/src/html/template/html.go
+++ b/src/html/template/html.go
@@ -240,8 +240,7 @@ func htmlNameFilter(args ...interface{}) string {
}
s = strings.ToLower(s)
if t := attrType(s); t != contentTypePlain {
- // TODO: Split attr and element name part filters so we can allowlist
- // attributes.
+ // TODO: Split attr and element name part filters so we can recognize known attributes.
return filterFailsafe
}
for _, r := range s {
diff --git a/src/net/http/request.go b/src/net/http/request.go
index e4a00dd569..fe6b60982c 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -503,7 +503,7 @@ func valueOrDefault(value, def string) string {
// NOTE: This is not intended to reflect the actual Go version being used.
// It was changed at the time of Go 1.1 release because the former User-Agent
-// had ended up on a blocklist for some intrusion detection systems.
+// had ended up blocked by some intrusion detection systems.
// See https://codereview.appspot.com/7532043.
const defaultUserAgent = "Go-http-client/1.1"
diff --git a/src/net/http/server.go b/src/net/http/server.go
index a75dd1461f..a995a50658 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -1698,9 +1698,9 @@ func (c *conn) closeWriteAndWait() {
time.Sleep(rstAvoidanceDelay)
}
-// validNextProto reports whether the proto is not a blocklisted ALPN
-// protocol name. Empty and built-in protocol types are blocklisted
-// and can't be overridden with alternate implementations.
+// validNextProto reports whether the proto is a valid ALPN protocol name.
+// Everything is valid except the empty string and built-in protocol types,
+// so that those can't be overridden with alternate implementations.
func validNextProto(proto string) bool {
switch proto {
case "", "http/1.1", "http/1.0":
diff --git a/src/runtime/cgo_sigaction.go b/src/runtime/cgo_sigaction.go
index 967b8b9a0d..de634dc957 100644
--- a/src/runtime/cgo_sigaction.go
+++ b/src/runtime/cgo_sigaction.go
@@ -18,12 +18,12 @@ var _cgo_sigaction unsafe.Pointer
//go:nosplit
//go:nowritebarrierrec
func sigaction(sig uint32, new, old *sigactiont) {
- // The runtime package is explicitly blocklisted from sanitizer
- // instrumentation in racewalk.go, but we might be calling into instrumented C
- // functions here — so we need the pointer parameters to be properly marked.
+ // racewalk.go avoids adding sanitizing instrumentation to package runtime,
+ // but we might be calling into instrumented C functions here,
+ // so we need the pointer parameters to be properly marked.
//
- // Mark the input as having been written before the call and the output as
- // read after.
+ // Mark the input as having been written before the call
+ // and the output as read after.
if msanenabled && new != nil {
msanwrite(unsafe.Pointer(new), unsafe.Sizeof(*new))
}
diff --git a/src/runtime/debugcall.go b/src/runtime/debugcall.go
index 496e6ce8cc..6c285ec829 100644
--- a/src/runtime/debugcall.go
+++ b/src/runtime/debugcall.go
@@ -61,7 +61,7 @@ func debugCallCheck(pc uintptr) string {
"debugCall16384",
"debugCall32768",
"debugCall65536":
- // These functions are allowlisted so that the debugger can initiate multiple function calls.
+ // These functions are allowed so that the debugger can initiate multiple function calls.
// See: https://golang.org/cl/161137/
return
}
From e64675a79fef5924f268425de021372df874010e Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor
-TODO -
-
From e031318ca6da8db8a08ecff734ae72290dfb5f2d Mon Sep 17 00:00:00 2001
From: Xiangdong Ji
- TODO: https://golang.org/cl/231418: only support "chunked" in inbound Transfer-Encoding headers
+
+ Parsing is now stricter as a hardening measure against request smuggling attacks:
+ non-ASCII white space is no longer trimmed like SP and HTAB, and support for the
+ "
@@ -655,7 +657,9 @@ Do not send CLs removing the interior tags from such phrases.
identity" Transfer-Encoding was dropped.
- TODO: https://golang.org/cl/224897: make Switching Protocol requests (e.g. Websockets) cancelable
+ When a Switching Protocol (like WebSocket) request handled by
+ ReverseProxy
+ is canceled, the backend connection is now correctly closed.
ClientAuthType
now implement fmt.Stringer.
+
+
+ The ConnectionState
+ fields OCSPResponse and SignedCertificateTimestamps
+ are now repopulated on client-side resumed connections.
+
ClientAuthType
now implement fmt.Stringer.
-
+
The ConnectionState
fields OCSPResponse and SignedCertificateTimestamps
@@ -569,7 +569,13 @@ Do not send CLs removing the interior tags from such phrases.
- TODO: https://golang.org/cl/203417: fix reserved namespace check to be case-insensitive
+ The encoder has always taken care to avoid using namespace prefixes beginning with
+ xml,
+ which are reserved by the XML specification.
+ Now, following the specification more closely,
+ that check is case-insensitive, so that prefixes beginning with
+ XML, XmL,
+ and so on are also avoided.