diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-03-08 17:29:09 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-03-10 10:29:57 +0100 |
| commit | bed5061dadf89f8112a73e495a9dfd576453dc67 (patch) | |
| tree | a1ed7ddf3b03cc93b95c58d7e51138ee70abe004 /wireguard/libwg | |
| parent | 156849174f40fb1284908193eaeaece85c14a930 (diff) | |
| download | mullvadvpn-bed5061dadf89f8112a73e495a9dfd576453dc67.tar.xz mullvadvpn-bed5061dadf89f8112a73e495a9dfd576453dc67.zip | |
Update Android Docker image
Diffstat (limited to 'wireguard/libwg')
| -rw-r--r-- | wireguard/libwg/Dockerfile | 20 | ||||
| -rw-r--r-- | wireguard/libwg/goruntime-boottime-over-monotonic.diff | 68 |
2 files changed, 45 insertions, 43 deletions
diff --git a/wireguard/libwg/Dockerfile b/wireguard/libwg/Dockerfile index 1e7422edab..d53fdff78e 100644 --- a/wireguard/libwg/Dockerfile +++ b/wireguard/libwg/Dockerfile @@ -16,25 +16,27 @@ RUN apt-get update -y && apt-get install -y \ # Install Android NDK RUN cd /tmp && \ - curl -sf -L -O https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip && \ - test $(sha256sum android-ndk-r20-linux-x86_64.zip | cut -f1 -d' ') = "57435158f109162f41f2f43d5563d2164e4d5d0364783a9a6fab3ef12cb06ce0" && \ + curl -sf -L -o ndk.zip https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip && \ + echo "8381c440fe61fcbb01e209211ac01b519cd6adf51ab1c2281d5daad6ca4c8c8c ndk.zip" | sha256sum -c - && \ mkdir /opt/android && \ cd /opt/android && \ - unzip -q /tmp/android-ndk-r20-linux-x86_64.zip && \ - rm /tmp/android-ndk-r20-linux-x86_64.zip + unzip -q /tmp/ndk.zip && \ + rm /tmp/ndk.zip -ENV ANDROID_NDK_HOME="/opt/android/android-ndk-r20" +ENV ANDROID_NDK_HOME="/opt/android/android-ndk-r20b" +ENV GOLANG_VERSION 1.16 +ENV GOLANG_HASH 013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2 # Install Go-lang and patch it to use the appropriate monotonic clock COPY goruntime-boottime-over-monotonic.diff /opt/goruntime-boottime-over-monotonic.diff RUN cd /tmp && \ - curl -sf -L -O https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz && \ - echo "0804bf02020dceaa8a7d7275ee79f7a142f1996bfd0c39216ccb405f93f994c0 go1.13.3.linux-amd64.tar.gz" | sha256sum --check && \ + curl -sf -L -o go.tgz https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz && \ + echo "${GOLANG_HASH} go.tgz" | sha256sum -c - && \ cd /opt && \ - tar -xzf /tmp/go1.13.3.linux-amd64.tar.gz && \ - rm /tmp/go1.13.3.linux-amd64.tar.gz && \ + tar -xzf /tmp/go.tgz && \ + rm /tmp/go.tgz && \ patch -p1 -f -N -r- -d "/opt/go" < /opt/goruntime-boottime-over-monotonic.diff ENV PATH=${PATH}:/opt/go/bin diff --git a/wireguard/libwg/goruntime-boottime-over-monotonic.diff b/wireguard/libwg/goruntime-boottime-over-monotonic.diff index e5c668bde1..5cbc225674 100644 --- a/wireguard/libwg/goruntime-boottime-over-monotonic.diff +++ b/wireguard/libwg/goruntime-boottime-over-monotonic.diff @@ -1,6 +1,6 @@ -From 6998a7866b8428fd49c31506795c9f8154826d13 Mon Sep 17 00:00:00 2001 +From b83553d9f260ba20c6faaa52e6fe6f74309eb41a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" <Jason@zx2c4.com> -Date: Wed, 27 Feb 2019 05:05:44 +0100 +Date: Mon, 22 Feb 2021 02:36:03 +0100 Subject: [PATCH] runtime: use CLOCK_BOOTTIME in nanotime on Linux This makes timers account for having expired while a computer was @@ -28,10 +28,10 @@ Change-Id: I7b2a6ca0c5bc5fce57ec0eeafe7b68270b429321 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s -index 40b55a67eb..6105780ff4 100644 +index 1e3a834812..78b6021fc7 100644 --- a/src/runtime/sys_linux_386.s +++ b/src/runtime/sys_linux_386.s -@@ -288,13 +288,13 @@ noswitch: +@@ -337,13 +337,13 @@ noswitch: LEAL 8(SP), BX // &ts (struct timespec) MOVL BX, 4(SP) @@ -48,20 +48,20 @@ index 40b55a67eb..6105780ff4 100644 INVOKE_SYSCALL diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s -index b709f77060..18a1f1d43a 100644 +index 37cb8dad03..e8b730bcaa 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s -@@ -261,7 +261,7 @@ noswitch: - MOVQ runtime·vdsoClockgettimeSym(SB), AX - CMPQ AX, $0 - JEQ fallback +@@ -302,7 +302,7 @@ noswitch: + SUBQ $16, SP // Space for results + ANDQ $~15, SP // Align for C code + - MOVL $1, DI // CLOCK_MONOTONIC + MOVL $7, DI // CLOCK_BOOTTIME LEAQ 0(SP), SI - CALL AX - MOVQ 0(SP), AX // sec + MOVQ runtime·vdsoClockgettimeSym(SB), AX + CMPQ AX, $0 diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s -index 43a58335c8..8b93635f4f 100644 +index 475f52344c..bb567abcf4 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -11,7 +11,7 @@ @@ -73,17 +73,17 @@ index 43a58335c8..8b93635f4f 100644 // for EABI, as we don't support OABI #define SYS_BASE 0x0 -@@ -291,7 +291,7 @@ noswitch: +@@ -366,7 +366,7 @@ noswitch: SUB $24, R13 // Space for results BIC $0x7, R13 // Align for C code - MOVW $CLOCK_MONOTONIC, R0 + MOVW $CLOCK_BOOTTIME, R0 MOVW $8(R13), R1 // timespec - MOVW runtime·vdsoClockgettimeSym(SB), R11 - CMP $0, R11 + MOVW runtime·vdsoClockgettimeSym(SB), R2 + CMP $0, R2 diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s -index 8b344be8f8..daf142fba0 100644 +index 198a5bacef..9715387f36 100644 --- a/src/runtime/sys_linux_arm64.s +++ b/src/runtime/sys_linux_arm64.s @@ -13,7 +13,7 @@ @@ -95,7 +95,7 @@ index 8b344be8f8..daf142fba0 100644 #define SYS_exit 93 #define SYS_read 63 -@@ -247,7 +247,7 @@ noswitch: +@@ -319,7 +319,7 @@ noswitch: BIC $15, R1 MOVD R1, RSP @@ -103,59 +103,59 @@ index 8b344be8f8..daf142fba0 100644 + MOVW $CLOCK_BOOTTIME, R0 MOVD runtime·vdsoClockgettimeSym(SB), R2 CBZ R2, fallback - BL (R2) + diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s -index c45703d228..9842b596e7 100644 +index c3e9f37694..e3879acd38 100644 --- a/src/runtime/sys_linux_mips64x.s +++ b/src/runtime/sys_linux_mips64x.s -@@ -189,7 +189,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$16 - RET +@@ -312,7 +312,7 @@ noswitch: + AND $~15, R1 // Align for C code + MOVV R1, R29 - TEXT runtime·nanotime(SB),NOSPLIT,$16 - MOVW $1, R4 // CLOCK_MONOTONIC + MOVW $7, R4 // CLOCK_BOOTTIME MOVV $0(R29), R5 - MOVV $SYS_clock_gettime, R2 - SYSCALL + + MOVV runtime·vdsoClockgettimeSym(SB), R25 diff --git a/src/runtime/sys_linux_mipsx.s b/src/runtime/sys_linux_mipsx.s -index f362b0f3f1..5ab866e047 100644 +index fab2ab3892..f9af103594 100644 --- a/src/runtime/sys_linux_mipsx.s +++ b/src/runtime/sys_linux_mipsx.s -@@ -193,7 +193,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$8-12 +@@ -238,7 +238,7 @@ TEXT runtime·walltime1(SB),NOSPLIT,$8-12 RET - TEXT runtime·nanotime(SB),NOSPLIT,$8-8 + TEXT runtime·nanotime1(SB),NOSPLIT,$8-8 - MOVW $1, R4 // CLOCK_MONOTONIC + MOVW $7, R4 // CLOCK_BOOTTIME MOVW $4(R29), R5 MOVW $SYS_clock_gettime, R2 SYSCALL diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s -index 6835f434de..46618b2d91 100644 +index fd69ee70a5..ff6bc8355b 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s -@@ -204,7 +204,7 @@ fallback: +@@ -249,7 +249,7 @@ fallback: JMP finish - TEXT runtime·nanotime(SB),NOSPLIT,$16 + TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 - MOVD $1, R3 // CLOCK_MONOTONIC + MOVD $7, R3 // CLOCK_BOOTTIME MOVD R1, R15 // R15 is unchanged by C code MOVD g_m(g), R21 // R21 = m diff --git a/src/runtime/sys_linux_s390x.s b/src/runtime/sys_linux_s390x.s -index c79ceea751..44e3258e60 100644 +index c15a1d5364..f52c4d5098 100644 --- a/src/runtime/sys_linux_s390x.s +++ b/src/runtime/sys_linux_s390x.s -@@ -180,7 +180,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$16 +@@ -207,7 +207,7 @@ TEXT runtime·walltime1(SB),NOSPLIT,$16 RET - TEXT runtime·nanotime(SB),NOSPLIT,$16 + TEXT runtime·nanotime1(SB),NOSPLIT,$16 - MOVW $1, R2 // CLOCK_MONOTONIC + MOVW $7, R2 // CLOCK_BOOTTIME MOVD $tp-16(SP), R3 MOVW $SYS_clock_gettime, R1 SYSCALL -- -2.20.1 +2.30.1 |
