pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/pkgsrc-2017Q4]: pkgsrc/lang/go Pullup ticket #5703 - requested by bsi...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/22f135aa655b
branches:  pkgsrc-2017Q4
changeset: 373135:22f135aa655b
user:      spz <spz%pkgsrc.org@localhost>
date:      Sat Feb 24 11:16:59 2018 +0000

description:
Pullup ticket #5703 - requested by bsiegert
lang/go: security update

Revisions pulled up:
- lang/go/Makefile                                              1.59-1.60
- lang/go/PLIST                                                 1.35-1.38
- lang/go/distinfo                                              1.54-1.57
- lang/go/patches/patch-src_cmd_dist_util.go                    1.1
- lang/go/patches/patch-src_cmd_link_internal_ld_elf.go         1.1-1.2
- lang/go/patches/patch-src_runtime_os__netbsd.go               1.3
- lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s          1.1
- lang/go/version.mk                                            1.31-1.32,1.34

-------------------------------------------------------------------
   Module Name: pkgsrc
   Committed By:        christos
   Date:                Sat Jan 20 16:55:06 UTC 2018

   Modified Files:
        pkgsrc/lang/go: Makefile PLIST distinfo version.mk
   Added Files:
        pkgsrc/lang/go/patches: patch-src_cmd_dist_util.go
            patch-src_cmd_link_internal_ld_elf.go
            patch-src_runtime_os__netbsd.go
            patch-src_runtime_rt0__netbsd__arm.s

   Log Message:
   Add Yasushi Oshima patches for arm from:
       https://github.com/oshimaya/pkgsrc/tree/master/lang/go


   To generate a diff of this commit:
   cvs rdiff -u -r1.58 -r1.59 pkgsrc/lang/go/Makefile
   cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/go/PLIST
   cvs rdiff -u -r1.53 -r1.54 pkgsrc/lang/go/distinfo
   cvs rdiff -u -r1.30 -r1.31 pkgsrc/lang/go/version.mk
   cvs rdiff -u -r0 -r1.1 pkgsrc/lang/go/patches/patch-src_cmd_dist_util.go \
       pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go \
       pkgsrc/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s
   cvs rdiff -u -r0 -r1.3 pkgsrc/lang/go/patches/patch-src_runtime_os__netbsd.go

-------------------------------------------------------------------
   Module Name: pkgsrc
   Committed By:        ryoon
   Date:                Sun Jan 21 01:28:39 UTC 2018

   Modified Files:
        pkgsrc/lang/go: PLIST

   Log Message:
   Fix packaging


   To generate a diff of this commit:
   cvs rdiff -u -r1.35 -r1.36 pkgsrc/lang/go/PLIST

-------------------------------------------------------------------
   Module Name: pkgsrc
   Committed By:        christos
   Date:                Sat Jan 20 18:13:25 UTC 2018

   Modified Files:
        pkgsrc/lang/go: distinfo
        pkgsrc/lang/go/patches: patch-src_cmd_link_internal_ld_elf.go

   Log Message:
   fix the path


   To generate a diff of this commit:
   cvs rdiff -u -r1.54 -r1.55 pkgsrc/lang/go/distinfo
   cvs rdiff -u -r1.1 -r1.2 \
       pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go

-------------------------------------------------------------------
   Module Name: pkgsrc
   Committed By:        bsiegert
   Date:                Sun Jan 28 11:31:03 UTC 2018

   Modified Files:
        pkgsrc/lang/go: Makefile PLIST distinfo version.mk

   Log Message:
   Update Go to 1.9.3.

   This release includes fixes to the compiler, runtime, and the database/sql,
   math/big, net/http, and net/url packages.

   View the release notes for more information:
        https://golang.org/doc/devel/release.html#go1.9.minor


   To generate a diff of this commit:
   cvs rdiff -u -r1.59 -r1.60 pkgsrc/lang/go/Makefile
   cvs rdiff -u -r1.36 -r1.37 pkgsrc/lang/go/PLIST
   cvs rdiff -u -r1.55 -r1.56 pkgsrc/lang/go/distinfo
   cvs rdiff -u -r1.31 -r1.32 pkgsrc/lang/go/version.mk

-------------------------------------------------------------------
   Module Name: pkgsrc
   Committed By:        bsiegert
   Date:                Thu Feb  8 19:32:17 UTC 2018

   Modified Files:
        pkgsrc/lang/go: PLIST distinfo version.mk

   Log Message:
   Update Go to 1.9.4.

   By using the clang or gcc plugin mechanism, it was possible for an attacker to
   trick the ?go get? command into executing arbitrary code. The go command now
   restricts the set of allowed host compiler and linker arguments in cgo source
   files to a list of allowed flags, in particular disallowing -fplugin= and
   -plugin=.

   The issue is CVE-2018-6574 and Go issue golang.org/issue/23672. See the Go
   issue for details.

   Thanks to Christopher Brown of Mattermost for reporting this problem.


   To generate a diff of this commit:
   cvs rdiff -u -r1.37 -r1.38 pkgsrc/lang/go/PLIST
   cvs rdiff -u -r1.56 -r1.57 pkgsrc/lang/go/distinfo
   cvs rdiff -u -r1.33 -r1.34 pkgsrc/lang/go/version.mk

diffstat:

 lang/go/Makefile                                      |   9 +-
 lang/go/PLIST                                         |  10 ++-
 lang/go/distinfo                                      |  14 ++-
 lang/go/patches/patch-src_cmd_dist_util.go            |  16 +++
 lang/go/patches/patch-src_cmd_link_internal_ld_elf.go |  85 +++++++++++++++++++
 lang/go/patches/patch-src_runtime_os__netbsd.go       |  21 ++++
 lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s  |  13 ++
 lang/go/version.mk                                    |  13 ++-
 8 files changed, 167 insertions(+), 14 deletions(-)

diffs (281 lines):

diff -r bdd6980c911f -r 22f135aa655b lang/go/Makefile
--- a/lang/go/Makefile  Sat Feb 24 00:02:25 2018 +0000
+++ b/lang/go/Makefile  Sat Feb 24 11:16:59 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.58 2017/11/14 09:53:53 wiz Exp $
+# $NetBSD: Makefile,v 1.58.2.1 2018/02/24 11:16:59 spz Exp $
 
 .include "version.mk"
 
@@ -37,6 +37,7 @@
 REPLACE_BASH+= misc/cgo/testgodefs/test.bash
 REPLACE_BASH+= misc/cgo/testplugin/test.bash
 REPLACE_BASH+= misc/cgo/testsanitizers/test.bash
+REPLACE_BASH+= misc/cgo/testplugin/test.bash
 REPLACE_BASH+= misc/nacl/go_nacl_386_exec
 REPLACE_BASH+= misc/nacl/go_nacl_amd64p32_exec
 REPLACE_BASH+= misc/nacl/go_nacl_arm_exec
@@ -92,9 +93,9 @@
 .endif
 
 do-build:
-       cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} ${BASH} ./make.bash
+       cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} ${GOOPT} ${BASH} ./make.bash
 # for RELRO build:
-#      cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${BASH} ./make.bash
+#      cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${GOOPT} ${BASH} ./make.bash
 
 do-install:
        cd ${WRKSRC} && rm -rf .hgignore .hgtags pkg/obj
@@ -105,6 +106,6 @@
 .endfor
 
 do-test:
-       cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${BASH} run.bash --no-rebuild --banner ""
+       cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${GOOPT} ${BASH} run.bash --no-rebuild --banner ""
 
 .include "../../mk/bsd.pkg.mk"
diff -r bdd6980c911f -r 22f135aa655b lang/go/PLIST
--- a/lang/go/PLIST     Sat Feb 24 00:02:25 2018 +0000
+++ b/lang/go/PLIST     Sat Feb 24 11:16:59 2018 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.34 2017/10/28 18:20:14 bsiegert Exp $
+@comment $NetBSD: PLIST,v 1.34.2.1 2018/02/24 11:16:59 spz Exp $
 bin/go
 bin/gofmt
 go/AUTHORS
@@ -1789,6 +1789,8 @@
 go/src/cmd/go/internal/web/security.go
 go/src/cmd/go/internal/work/build.go
 go/src/cmd/go/internal/work/build_test.go
+go/src/cmd/go/internal/work/security.go
+go/src/cmd/go/internal/work/security_test.go
 go/src/cmd/go/internal/work/testgo.go
 go/src/cmd/go/main.go
 go/src/cmd/go/mkalldocs.sh
@@ -5127,6 +5129,7 @@
 go/src/runtime/testdata/testprogcgo/pprof.go
 go/src/runtime/testdata/testprogcgo/raceprof.go
 go/src/runtime/testdata/testprogcgo/racesig.go
+go/src/runtime/testdata/testprogcgo/sigstack.go
 go/src/runtime/testdata/testprogcgo/threadpanic.go
 go/src/runtime/testdata/testprogcgo/threadpanic_unix.c
 go/src/runtime/testdata/testprogcgo/threadpanic_windows.c
@@ -6857,6 +6860,11 @@
 go/test/fixedbugs/issue21655.go
 go/test/fixedbugs/issue21963.go
 go/test/fixedbugs/issue22083.go
+go/test/fixedbugs/issue22429.go
+go/test/fixedbugs/issue22458.go
+go/test/fixedbugs/issue22683.go
+go/test/fixedbugs/issue22683.out
+go/test/fixedbugs/issue22781.go
 go/test/fixedbugs/issue2615.go
 go/test/fixedbugs/issue3552.dir/one.go
 go/test/fixedbugs/issue3552.dir/two.go
diff -r bdd6980c911f -r 22f135aa655b lang/go/distinfo
--- a/lang/go/distinfo  Sat Feb 24 00:02:25 2018 +0000
+++ b/lang/go/distinfo  Sat Feb 24 11:16:59 2018 +0000
@@ -1,8 +1,12 @@
-$NetBSD: distinfo,v 1.53 2017/10/28 18:20:14 bsiegert Exp $
+$NetBSD: distinfo,v 1.53.2.1 2018/02/24 11:16:59 spz Exp $
 
-SHA1 (go1.9.2.src.tar.gz) = 8a51dbdf51d6ee0e058b7de7c7606dbea23dfeec
-RMD160 (go1.9.2.src.tar.gz) = f8ae6b41af3f450b0d9a3d33aa9e0d5df39904d4
-SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5
-Size (go1.9.2.src.tar.gz) = 16383591 bytes
+SHA1 (go1.9.4.src.tar.gz) = 12b0ecee83525cd594f4fbf30380d4832e06f189
+RMD160 (go1.9.4.src.tar.gz) = 801d6a8a57d2dc0fefba283ea1ae456b869a7398
+SHA512 (go1.9.4.src.tar.gz) = 1a7c830e07507ff7b89025adfb5c713444d97301f8ad47ef2564722c1e28186e946350f07e22777fbdd6f2f589c334eb01dfd589e97cb8a86f73669547badb0b
+Size (go1.9.4.src.tar.gz) = 16392325 bytes
 SHA1 (patch-misc_io_clangwrap.sh) = cd91c47ba0fe7b6eb8009dd261c0c26c7d581c29
+SHA1 (patch-src_cmd_dist_util.go) = 24e6f1b6ded842a8ce322a40e8766f7d344bc47e
+SHA1 (patch-src_cmd_link_internal_ld_elf.go) = acc8d92b7eae1b77470bd3e88af93d458695ac76
 SHA1 (patch-src_crypto_x509_root__bsd.go) = 93a2de7c685a0919fe93f5bc99f156e105dace4d
+SHA1 (patch-src_runtime_os__netbsd.go) = 9b80de94667e3f8d8d1ae3648ab1fe43dd55d577
+SHA1 (patch-src_runtime_rt0__netbsd__arm.s) = 45e727f4e89470505664e7c38bdb8ebd314bcaf5
diff -r bdd6980c911f -r 22f135aa655b lang/go/patches/patch-src_cmd_dist_util.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go/patches/patch-src_cmd_dist_util.go        Sat Feb 24 11:16:59 2018 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_cmd_dist_util.go,v 1.1.2.2 2018/02/24 11:16:59 spz Exp $
+
+--- src/cmd/dist/util.go.orig  2017-02-16 19:12:22.000000000 +0000
++++ src/cmd/dist/util.go
+@@ -531,6 +531,11 @@ func xgetgoarm() string {
+               // sense to auto-detect the setting.
+               return "7"
+       }
++      if goos == "netbsd" {
++              // NetBSD go/arm support only earmv6hf or earmv7hf now.
++              // Any armv5 (or before) devices cannot work.
++              return "6"
++      }
+       if gohostarch != "arm" || goos != gohostos {
+               // Conservative default for cross-compilation.
+               return "5"
diff -r bdd6980c911f -r 22f135aa655b lang/go/patches/patch-src_cmd_link_internal_ld_elf.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go     Sat Feb 24 11:16:59 2018 +0000
@@ -0,0 +1,85 @@
+$NetBSD: patch-src_cmd_link_internal_ld_elf.go,v 1.2.2.2 2018/02/24 11:16:59 spz Exp $
+
+--- src/cmd/link/internal/ld/elf.go.orig       2017-10-25 14:30:21.000000000 -0400
++++ src/cmd/link/internal/ld/elf.go    2018-01-20 11:49:02.046813855 -0500
+@@ -1263,6 +1263,8 @@
+       ELF_NOTE_NETBSD_DESCSZ  = 4
+       ELF_NOTE_NETBSD_TAG     = 1
+       ELF_NOTE_NETBSD_VERSION = 599000000 /* NetBSD 5.99 */
++      ELF_NOTE_NETBSD_MARCH_NAMESZ = 7
++      ELF_NOTE_NETBSD_MARCH_TAG    = 5
+ )
+ 
+ var ELF_NOTE_NETBSD_NAME = []byte("NetBSD\x00")
+@@ -1272,6 +1274,23 @@
+       return elfnote(sh, startva, resoff, n, true)
+ }
+ 
++func elfnetbsdarmarch() []byte {
++      switch objabi.GOARM {
++      case 6:
++              return []byte("earmv6hf\x00")
++      case 7:
++              return []byte("earmv7hf\x00")
++      default:
++              return []byte("earm\x00")
++      }
++}
++
++func elfnetbsdarmsig(sh *ElfShdr, startva uint64, resoff uint64) int {
++      descsz := len(elfnetbsdarmarch())
++      n := int(Rnd(ELF_NOTE_NETBSD_MARCH_NAMESZ, 4) + Rnd(int64(descsz), 4))
++      return elfnote(sh, startva, resoff, n, true)
++}
++
+ func elfwritenetbsdsig() int {
+       // Write Elf_Note header.
+       sh := elfwritenotehdr(".note.netbsd.ident", ELF_NOTE_NETBSD_NAMESZ, ELF_NOTE_NETBSD_DESCSZ, ELF_NOTE_NETBSD_TAG)
+@@ -1285,7 +1304,20 @@
+       Cput(0)
+ 
+       Thearch.Lput(ELF_NOTE_NETBSD_VERSION)
+-
++      if SysArch.Family == sys.ARM {
++              mArch := elfnetbsdarmarch()
++              descsz := len(mArch)
++              sh2 := elfwritenotehdr(".note.netbsd.march",
++                      ELF_NOTE_NETBSD_MARCH_NAMESZ, uint32(descsz),
++                      ELF_NOTE_NETBSD_MARCH_TAG)
++              if sh2 == nil {
++                      return 0
++              }
++              Cwrite(ELF_NOTE_NETBSD_NAME)
++              Cput(0)
++              Cwrite(mArch)
++              return int(sh.size) + int(sh2.size)
++      }
+       return int(sh.size)
+ }
+ 
+@@ -1902,6 +1934,9 @@
+       }
+       if Headtype == objabi.Hnetbsd {
+               Addstring(shstrtab, ".note.netbsd.ident")
++              if SysArch.Family == sys.ARM {
++                      Addstring(shstrtab, ".note.netbsd.march")
++              }
+       }
+       if Headtype == objabi.Hopenbsd {
+               Addstring(shstrtab, ".note.openbsd.ident")
+@@ -2340,6 +2375,15 @@
+               pnote.flags = PF_R
+               phsh(pnote, sh)
+       }
++      if Headtype == objabi.Hnetbsd && SysArch.Family == sys.ARM {
++              var sh *ElfShdr
++              sh = elfshname(".note.netbsd.march")
++              resoff -= int64(elfnetbsdarmsig(sh, uint64(startva), uint64(resoff)))
++              pnote = newElfPhdr()
++              pnote.type_ = PT_NOTE
++              pnote.flags = PF_R
++              phsh(pnote, sh)
++      }
+ 
+       if len(buildinfo) > 0 {
+               sh := elfshname(".note.gnu.build-id")
diff -r bdd6980c911f -r 22f135aa655b lang/go/patches/patch-src_runtime_os__netbsd.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go/patches/patch-src_runtime_os__netbsd.go   Sat Feb 24 11:16:59 2018 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_runtime_os__netbsd.go,v 1.3.2.2 2018/02/24 11:16:59 spz Exp $
+
+--- src/runtime/os_netbsd.go.orig      2017-02-16 19:12:24.000000000 +0000
++++ src/runtime/os_netbsd.go
+@@ -79,13 +79,13 @@ var sigset_all = sigset{[4]uint32{^uint3
+ 
+ // From NetBSD's <sys/sysctl.h>
+ const (
+-      _CTL_HW      = 6
+-      _HW_NCPU     = 3
++      _CTL_HW  = 6
++      _HW_NCPUONLINE = 16
+       _HW_PAGESIZE = 7
+ )
+ 
+ func getncpu() int32 {
+-      mib := [2]uint32{_CTL_HW, _HW_NCPU}
++      mib := [2]uint32{_CTL_HW, _HW_NCPUONLINE}
+       out := uint32(0)
+       nout := unsafe.Sizeof(out)
+       ret := sysctl(&mib[0], 2, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
diff -r bdd6980c911f -r 22f135aa655b lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s      Sat Feb 24 11:16:59 2018 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_runtime_rt0__netbsd__arm.s,v 1.1.2.2 2018/02/24 11:17:00 spz Exp $
+
+--- src/runtime/rt0_netbsd_arm.s.orig  2017-02-16 19:12:24.000000000 +0000
++++ src/runtime/rt0_netbsd_arm.s
+@@ -9,3 +9,8 @@ TEXT _rt0_arm_netbsd(SB),NOSPLIT,$-4
+       MOVW    $4(R13), R1             // argv
+       MOVM.DB.W [R0-R1], (R13)
+       B runtime·rt0_go(SB)
++
++TEXT main(SB),NOSPLIT,$-4
++      MOVM.DB.W [R0-R1], (R13)
++      MOVW    $runtime·rt0_go(SB), R4
++      B       (R4)
diff -r bdd6980c911f -r 22f135aa655b lang/go/version.mk
--- a/lang/go/version.mk        Sat Feb 24 00:02:25 2018 +0000
+++ b/lang/go/version.mk        Sat Feb 24 11:16:59 2018 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: version.mk,v 1.30 2017/10/28 18:20:14 bsiegert Exp $
+# $NetBSD: version.mk,v 1.30.2.1 2018/02/24 11:16:59 spz Exp $
 
 .include "../../mk/bsd.prefs.mk"
 
-GO_VERSION=    1.9.2
+GO_VERSION=    1.9.4
 GO14_VERSION=  1.4.3
 
-ONLY_FOR_PLATFORM=     *-*-i386 *-*-x86_64 *-*-*arm*
+ONLY_FOR_PLATFORM=     *-*-i386 *-*-x86_64 *-*-earmv[67]hf
 NOT_FOR_PLATFORM=      SunOS-*-i386
 .if ${MACHINE_ARCH} == "i386"
 GOARCH=                386
@@ -13,9 +13,14 @@
 .elif ${MACHINE_ARCH} == "x86_64"
 GOARCH=                amd64
 GOCHAR=                6
-.elif !empty(MACHINE_ARCH:M*arm*)
+.elif ${MACHINE_ARCH} == "earmv6hf" || ${MACHINE_ARCH} == "earmv7hf"
 GOARCH=                arm
 GOCHAR=                5
 .endif
+.if ${MACHINE_ARCH} == "earmv6hf"
+GOOPT=         GOARM=6
+.elif ${MACHINE_ARCH} == "earmv7hf"
+GOOPT=         GOARM=7
+.endif
 PLIST_SUBST+=  GO_PLATFORM=${LOWER_OPSYS:Q}_${GOARCH:Q} GOARCH=${GOARCH:Q}
 PLIST_SUBST+=  GOCHAR=${GOCHAR:Q}



Home | Main Index | Thread Index | Old Index