Commit Graph

85 Commits

Author SHA1 Message Date
Andre Heider 565866a472 treewide: refactor to use PKG_BUILD_FLAGS:=no-mips16
See commit 5c545bdb "treewide: replace PKG_USE_MIPS16:=0 with
PKG_BUILD_FLAGS:=no-mips16" on the main repository.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Jeffery To 8711653f1e
golang: Update to 1.20.2, refresh patch
Includes fixes for:

* 1.20.1:
  * CVE-2022-41722: path/filepath: path traversal in filepath.Clean on
    Windows
  * CVE-2022-41723: net/http: avoid quadratic complexity in HPACK
    decoding
  * CVE-2022-41724: crypto/tls: large handshake records may cause panics
  * CVE-2022-41725: net/http, mime/multipart: denial of service from
    excessive resource consumption

* 1.20.2:
  * CVE-2023-24532: crypto/elliptic: specific unreduced P-256 scalars
    produce incorrect results

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-03-20 14:43:52 +08:00
Jeffery To 8677ed11e3
golang: Update to 1.19.7
Includes fix for CVE-2023-2453 (crypto/elliptic: specific unreduced
P-256 scalars produce incorrect results).

This also includes makefile updates for Go 1.19.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-03-14 14:23:35 +08:00
Tianling Shen 0cdd7b8c0e golang: Update to 1.19.6
go1.19.6 (released 2023-02-14) includes security fixes to the
crypto/tls, mime/multipart, net/http, and path/filepath packages,
as well as bug fixes to the go command, the linker, the runtime,
and the crypto/x509, net/http, and time packages.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-02-22 14:48:10 +08:00
Tianling Shen 5a25a731c6 golang: Update to 1.19.5
Go1.19.5 (released 2023-01-10) includes fixes to the compiler,
the linker, and the crypto/x509, net/http, sync/atomic,
and syscall packages.

Removed upstreamed patch.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-01-14 15:02:37 +08:00
Tianling Shen 6a0ee524b1
golang: Update to 1.19.4
go1.19.4 (released 2022-12-06) includes security fixes to the net/http
and os packages, as well as bug fixes to the compiler, the runtime,
and the crypto/x509, os/exec, and sync/atomic packages.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-12-08 00:43:34 +08:00
Stanislav Petrashov 440dcd8d34
golang: update to v1.19.3
Signed-off-by: Stanislav Petrashov <s@petrashov.ru>
2022-11-23 22:06:14 +01:00
Stanislav Petrashov 0ad7a2fe18
golang: update to v1.19.2
Includes fixes for security vulnerabilities:
 * [CVE-2022-27664](https://github.com/advisories/GHSA-69cg-p879-7622) net/http: handle server errors after sending GOAWAY
 * [CVE-2022-32190](https://github.com/golang/go/issues/54385) net/url: JoinPath does not strip relative path components in all circumstances
 * [CVE-2022-2879](https://github.com/golang/go/issues/54853) archive/tar: unbounded memory consumption when reading headers
 * [CVE-2022-2880](https://github.com/golang/go/issues/54663) net/http/httputil: ReverseProxy should not forward unparseable query parameters
 * [CVE-2022-41715](https://github.com/golang/go/issues/55949) regexp/syntax: limit memory used by parsing regexps

Addresses the build failure:
* https://github.com/openwrt/packages/pull/19613

Signed-off-by: Stanislav Petrashov <s@petrashov.ru>
2022-11-14 20:23:44 +01:00
Josef Schlehofer c33c2d8869 golang: update to version 1.18.8
Fixes following CVEs:
- CVE-2022-32189 (version 1.18.5 [1]]
- CVE-2022-27664 (version 1.18.6 [2])
- CVE-2022-32190 (version 1.18.6 [2])
- CVE-2022-2879 (version 1.18.7 [3])
- CVE-2022-2880 (version 1.18.7 [3])
- CVE-2022-41715 (version 1.18.7 [3])
- CVE-2022-41716 (version 1.18.8 [4])

and refreshed patch

[1] https://groups.google.com/g/golang-announce/c/YqYYG87xB10
[2] https://groups.google.com/g/golang-announce/c/x49AQzIVX-s
[3] https://groups.google.com/g/golang-announce/c/xtuG5faxtaU
[4] https://groups.google.com/g/golang-announce/c/mbHY1UY3BaM

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-11-10 09:15:41 +01:00
Jeffery To 60168651a2
golang: Update to 1.18.4
Includes fixes for:

* CVE-2022-1705: net/http: improper sanitization of Transfer-Encoding
  header
* CVE-2022-1962: go/parser: stack exhaustion in all Parse* functions
* CVE-2022-28131: encoding/xml: stack exhaustion in Decoder.Skip
* CVE-2022-30630: io/fs: stack exhaustion in Glob
* CVE-2022-30631: compress/gzip: stack exhaustion in Reader.Read
* CVE-2022-30632: path/filepath: stack exhaustion in Glob
* CVE-2022-30633: encoding/xml: stack exhaustion in Unmarshal
* CVE-2022-30635: encoding/gob: stack exhaustion in Decoder.Decode
* CVE-2022-32148: net/http/httputil: NewSingleHostReverseProxy - omit
  X-Forwarded-For not working

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-07-18 17:35:11 +08:00
Jeffery To 112cf09031 golang: Update to 1.18.3
Includes fix for CVE-2022-30634 (crypto/rand: Read hangs when passed
buffer larger than 1<<32 - 1).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-06-06 15:08:39 -07:00
Michael Pratt bb7c596028 golang: do not rely on Go script host detection
for some use cases, for example:
a system with 64 bit kernel
and 32 bit userspace programs

the local Go installation is "detected"
using the kernel "uname",
causing build failure if they happen to differ

by adding the argument GOHOSTARCH using the corresponding make variable
it would be fully controlled in the openwrt git tree
based on the HOST_ARCH make variable.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-05-27 02:39:52 -04:00
Michael Pratt abf28899a0 golang: split compile recipe into configure and compile
the default Configure recipe for packages
assumes that there is a "configure" script
in the source tree directory

Go does not have such a script,
configure and compile is done with the same script

so split the current Compile recipe
into both Configure and Compile recipes

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-05-27 02:39:52 -04:00
Jeffery To 659f87d5d4 golang: Update to 1.18.2
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-05-14 21:28:14 -07:00
Jeffery To 8c0477a895 golang: Update to 1.18.1
Includes fixes for:
* CVE-2022-24675 - encoding/pem: stack overflow
* CVE-2022-28327 - crypto/elliptic: generic P-256 panic when scalar has
  too many leading zeroes

This also adds -buildvcs=false to omit VCS information in Go programs.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-04-15 15:18:12 -07:00
Jeffery To 478666b00b golang: Update to 1.18, update patch
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-28 19:42:59 -07:00
Jeffery To 9704e900da golang: Update to 1.17.8
Includes fix for CVE-2022-24921 (regexp: stack overflow (process exit)
handling deeply nested regexp).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-06 19:38:35 -08:00
Jeffery To 69c53fcb6c golang: Update to 1.17.7, refresh patch
This includes fixes for:

* CVE-2022-23772: math/big: Rat.SetString may consume large amount of
  RAM and crash

* CVE-2022-23806: crypto/elliptic: IsOnCurve returns true for invalid
  field elements

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-02-14 17:17:07 -08:00
Jeffery To 71d0d9a877 golang: Update to 1.17.6
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-01-11 16:21:57 -08:00
Jeffery To eac2e91a28
golang: Update to 1.17.5, add patch
Includes fixes for:
* CVE-2021-44716: unbounded growth of HTTP/2 header canonicalization
  cache
* CVE-2021-44717: syscall.ForkExec error can close file descriptor 0

Added patches:
* 001-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-available.patch:
  https://github.com/golang/go/pull/49748 backported for Go 1.17,
  this removes the requirement for the gold linker when building Go
  programs that use Go plugins on arm/arm64

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-12-28 15:15:13 +08:00
Jeffery To 901f80aae7
golang: Update to 1.17.3
Contains fixes for:

* CVE-2021-41771: ImportedSymbols in debug/macho (for Open or OpenFat)
  accesses a memory location after the end of a buffer

* CVE-2021-41772: archive/zip Reader.Open panic via a crafted ZIP
  archive containing an invalid name or an empty filename field

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-11-19 03:40:17 +08:00
Jeffery To 7d3f28f970 golang: Update to 1.17.2
Includes fix for CVE-2021-38297 (passing very large arguments to WASM
module functions can cause portions of the module to be overwritten).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-10-10 18:27:37 -07:00
Jeffery To aa96b8408f
golang: Update to 1.17.1
Includes fix for CVE-2021-39293 (archive/zip: overflow in preallocation
check can cause OOM panic).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-09-13 05:24:58 +08:00
Jeffery To d0aab6b8bc
golang: Update to 1.17
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-08-23 00:37:25 +08:00
Jeffery To 4d7a71a7cb
golang: Update to 1.16.7
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-08-09 17:51:43 +08:00
Jeffery To c0c62227bd
golang: Update to 1.16.6
Includes fix for CVE-2021-34558 (crypto/tls: clients can panic when
provided a certificate of the wrong type for the negotiated parameters).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-07-19 06:44:52 +08:00
Jeffery To fe3c49fe07
golang: Update to 1.16.5
1.16.1 included fixes for:

* CVE-2021-27918 - encoding/xml: infinite loop when using
  xml.NewTokenDecoder with a custom TokenReader
* CVE-2021-27919 - archive/zip: can panic when calling Reader.Open

1.16.4 included fixes for:

* CVE-2021-31525 - net/http: ReadRequest can stack overflow due to
  recursion with very large headers

1.16.5 includes fixes for:

* CVE-2021-33195 - net: Lookup functions may return invalid host names
* CVE-2021-33196 - archive/zip: malformed archive may cause panic or
  memory exhaustion
* CVE-2021-33197 - net/http/httputil: ReverseProxy forwards Connection
  headers if first one is empty

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-06-11 16:26:56 +08:00
Jeffery To dc587eccb7
golang: Update to 1.16
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-02-22 17:01:56 +08:00
Jeffery To ded955be9b
golang: Update to 1.15.8
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-02-08 02:40:18 +08:00
Jeffery To c0fb05d670
golang: Update to 1.15.7
This includes fixes for:
* CVE-2021-3114: crypto/elliptic: incorrect operations on the P-224
  curve
* CVE-2021-3115: cmd/go: packages using cgo can cause arbitrary code
  execution on Windows

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-01-25 17:22:25 +08:00
Jeffery To b1db2761b2
golang: Update to 1.15.6
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-12-07 05:30:32 +08:00
Jeffery To bd38850609 golang: Update to 1.15.5
This includes security fixes for:
* CVE-2020-28362: panic during recursive division of very large numbers
* CVE-2020-28366: arbitrary code can be injected into cgo generated
  files
* CVE-2020-28367: improper validation of cgo flags can lead to remote
  code execution at build time

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-11-15 21:43:07 +02:00
Jeffery To 4404e0716e
golang: Update to 1.15.4
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-11-09 17:53:43 +08:00
Jeffery To d276c81ea8
golang: Update to 1.15.3
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-20 07:01:44 +08:00
Jeffery To d5dc30fe80
golang: Add option to enable Spectre mitigations
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:34:41 +08:00
Jeffery To 4773c288cd
golang: Quote variables passed to the shell
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:34:40 +08:00
Jeffery To a95afd67df
golang: Use external linking for target Go
In Go 1.15, the linker now defaults to internal linking mode for
-buildmode=pie on amd64 and arm64[1], however this results in go tool
binaries with the wrong dynamic linker/interpreter.

External linking is still used when PIE is enabled for other platforms,
whereas internal linking is used when PIE is not enabled.

This changes target Go to always use external linking, to fix PIE
binaries for amd64/arm64 and for consistency.

[1]: https://golang.org/doc/go1.15#linker

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:08 +08:00
Jeffery To 93ee27edb8
golang: Simplify target compile
* Reuse GO_PKG_ENABLE_PIE from golang-package.mk
* Replace $(if ...) with $(or ...) to get default values
* Refactor vars common to each compile stage into variable

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:08 +08:00
Jeffery To 03a1f87549
golang: Use GO_LDFLAGS to set buildmode=pie for host Go
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:07 +08:00
Jeffery To 66eabf18f5
golang: Refactor vars common to each host compile stage into variable
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:07 +08:00
Jeffery To 4fb4ec963f
golang: Simplify bootstrap stage
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:07 +08:00
Jeffery To 40bff64ad3
golang: Group variables by stage (bootstrap/host/target)
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:06 +08:00
Jeffery To 9074dbd917
golang: Share build cache across package builds
This also adds a config option GOLANG_BUILD_CACHE_DIR to customize the
location of the build cache directory.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:06 +08:00
Jeffery To 4674564e42
golang: Move config option into separate file
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-05 00:25:28 +08:00
Jeffery To fc7cf379e3
golang: Update to 1.15.2
1.15.1 includes a fix for CVE-2020-24553:
net/http/cgi,net/http/fcgi: Cross-Site Scripting (XSS) when Content-Type
is not specified

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-05 00:25:18 +08:00
Jeffery To 8433270034
golang: Update to 1.14.7
This includes a fix for CVE-2020-16845 (encoding/binary: ReadUvarint and
ReadVarint can read an unlimited number of bytes from invalid inputs).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-08-12 04:38:38 +08:00
Jeffery To adb43f7643
golang: Update to 1.14.6
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-07-20 03:10:57 +08:00
Jeffery To 4ea95b49a2
golang: Update to 1.14.4
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-06-08 16:06:53 +08:00
Jeffery To 2b8f9b7349 golang: Update to 1.14.3
This also removes a (useless) test for PKG_GO_ZBOOTSTRAP_MODS (it is
always non-empty).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-17 03:37:45 +08:00
Jeffery To da3fb97b9c golang: Set/reset default platform options for target Go compiler
Because the first stage for building target Go is actually a host build,
the default platform options (GO386, GOARM, etc.) are detected from the
host. These values are written to a source file and kept when building
the second stage.

This modifies this source file to set the appropriate values for the
target platform, and reset values for other platforms to their
cross-compiling / most compatible defaults.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-14 17:45:18 +08:00