Repository navigation
Abla 0.2.73
·
570 commits
to master
since this release
Behaviour changes and migration (read first)
- Raw memory and raw system calls from ordinary code are now errors.
The calls v0.2.72 warned about (warning[native.trust]) fail the build
withnative.trust:<name>:abla/unsafe's raw-address functions
(nativePointerAddress,nativePointerFromAddress, thecallNative*
family, raw loads and stores, MMIO), the raw constructors of
NativeByteBuffer,NativeI64CellandNativePointerCell, and the raw
system callslinuxSyscall0tolinuxSyscall6, whether called or taken
as a function value from a function that is nottrusted. Method-style
calls and operators that resolve to a restricted extension function are
checked the same way (a105e60), and an error reached through an
aliased import names the function itself (828d0e1). The fix is
the same as for the warning: put the raw part in a smalltrusted
function, or use a safe API (the buffer factories and their checked
methods,linuxRealtimeNanoseconds,secureRandomBytes,
linuxReadAtDescriptor,linuxTcpConnectStart,
linuxSocketPendingError,linuxFileSync, the socket timeout setters).
A dependency that definestrustedcode needs your project's
trusted.nativeline. Build with v0.2.72 first to see every site as a
warning. (eac5682, decisions #130 and #133) - The raw big-number engine is no longer public. The 40
bn*
functions ofabla/crypto/bignum(bnLoad,bnStore,bnAllocate,
bnRelease,bnMultiply,bnEncode,bnDecode,bnExpPublic,
bnExpSecret,bnEqual, the Montgomery and lookup helpers, and the
rest) and classBnModulustook raw work areas and are now internal. Use
BigModulusandBigNumberfrom the same module (since v0.2.72), which
own and wipe their memory and check every width. This was the last
standard-library function that took a raw address and could still be
imported. (241b560, decision #122)
Highlights
- GPU kernels, steps 2 and 3 (experimental).
@kernelfunctions get
what real kernels need, every access bounds-checked by default:
workgroup shared memory (kernelSharedF32,kernelSharedU32) and
kernelBarrier, u16 and byte buffers,KernelF32Buffer.load4(one
16-byte load when aligned and inside the buffer), half-precision floats
(kernelF16ToF32),kernelSubgroupMax,kernelSqrt,kernelRsqrtand
kernelExp(which matches CUDA C'sexpfinstruction for instruction).
A trusted kernel can use an unchecked fast path (loadUnchecked,
load4Aligned,loadU16Aligned,loadU32Aligned: one plain load each
on the GPU, still checked on the CPU), andisAlignedlets it pick its
aligned loop once. A Q8_0 matrix-vector product and an RMS norm run on
the GPU and the CPU with the same results. (cdb8f46, 8a43392,
824cb07, f47fc98, decision #143)
Platforms
- RISC-V 64 Linux is documented (tier 2): docs/platforms.md lists the
RV64 hosted target and says what is proven (the compiler reproduces
itself under QEMU) and what is not; there is no RV64 release asset yet.
(ad9e423, decision #144) - Cross-architecture parity: every module program now runs under QEMU
for AArch64 and RISC-V 64 in CI and must print what it prints on x86-64.
(130b50e, #1208) - Android seccomp: a test checks that every system call an Abla Android
library can make is allowed by the app seccomp policy on API 26 to 36.
(9e49073, #1194)
Fixes
- Playground limits (medium-low): in the browser playground, a program
that printed without end could hand the page hundreds of megabytes of
output and freeze the tab, and the browser compiler could grow to
nearly 2 GB. Output is now capped at 1 MiB per stream (the run stops with
a note), the compiler's memory at 1 GiB (with a clear message), and an
in-memory file at 64 MiB. (8903474) - Windows system roots (medium-low): on Windows, the TLS client's
system root store ignored Windows' own distrust: a certificate in the
Disallowed store, or a root whose enhanced key usage excludes server
authentication, still anchored a chain. Both are now refused. A machine
that has not yet loaded a public root from Windows Update fails closed
with "unknown authority"; setSSL_CERT_FILEto a CA bundle there.
(a5a6415)
Known issue
- GPU kernels (experimental): code that is not
trustedcan useabla/kernelto read or write memory it does not own, through the CUDA host types and kernel launches (since v0.2.72) and through workgroup shared memory on the CPU backend (since v0.2.73). Until v0.2.77, don't build dependencies you don't trust that importabla/kernel. Fixed in v0.2.77. await task { ... }orawait thread { ... }, with the task or thread written directly afterawait, doesn't keep it alive while it runs: a garbage collection inside its body can free it, and the program crashes or uses freed memory. Until v0.2.77, bind the task or thread to avalfirst (val t = task { ... }; await t). Fixed in v0.2.77.- Reading a very long number as a floating-point value (
parseFloat, JSON'sasF64orreadNumber,strtod) takes time quadratic in its digits, so one request carrying a JSON number of about a megabyte can keep a server busy for minutes. Until v0.2.77, reject or truncate numbers longer than a few hundred digits before converting them, or keep request bodies small. Fixed in v0.2.77. - A dependency's compile-time transform, or its custom
$syntax handler, can run compile-time code with your project's own compile-time grants (process, environment, file writes, network, native code), not the dependency's. Until v0.2.74, don't authorize those capabilities for your own project when you build with dependencies you don't trust. Fixed in v0.2.74, except for the case below. - A compile-time
#site that a dependency's custom$syntax handler builds into your file runs with your project's own compile-time grants (process, environment, file writes, network, native code), not the dependency's. Until v0.2.78, don't authorize those capabilities in a file that uses$syntax from a dependency you don't trust. Fixed in v0.2.78. ablac package updatecan run a dependency's compile-time import-provider code with your project's own compile-time grants (process, file writes, network), before the dependency is locked. Until v0.2.74, don't authorize those capabilities for your own project while you update dependencies you don't trust. Fixed in v0.2.74.- Ordinary code can write fields that the standard library's native buffers and cells rely on (
closedof aNativeByteBuffer,NativeI64CellorNativePointerCell), so safe code can reach memory it doesn't own. Until v0.2.79, don't write those fields outside the standard library, and check that your dependencies don't. Fixed in v0.2.79. - Safe code can make the GPU kernel runtime (
abla/kernel,abla/kernel/cuda) read or write memory it doesn't own. Until v0.2.79, don't run kernel code from dependencies you don't trust, open one CUDA device at a time, and don't upload to or download into a buffer you have closed. Fixed in v0.2.79. - A dependency's custom
$syntax handler can have code of its own run at compile time with the grants of your file that uses the syntax (process, environment, file writes, network, native code). Until v0.2.79, don't authorize those capabilities in a file that uses$syntax from a dependency you don't trust. Fixed in v0.2.79. - A dependency's prepared copy in
.abla/packages/is trusted by its marker files without checking its contents againstabla.lockin single-file builds, and in project builds that also have a vendored copy, so a changed copy (from a restored CI cache, or committed next to a reviewed lock) is built as is. Until v0.2.79, delete.abla/packages/before building when it may come from somewhere you don't control (it is fetched again and checked), and don't cache or commit it. Fixed in v0.2.79. - The HTTP clients (
HttpClient.send,HttpAsyncClient, and the WebSocket TLS client's upgrade request) write the method, path and header values they are given without checking them, so a line break in a value that came from user input can add headers or a second request. Until v0.2.79, percent-encode user input in paths and queries (percentEncode) and refuse CR, LF and other control bytes in header values before passing them to a client. Fixed in v0.2.79. - The static Linux compiler's own hardening was weaker than a glibc build's: its stack-protector canary was a fixed value on AArch64, its
_FORTIFY_SOURCEbuffer checks did nothing, andrealpathcould overrun its caller's buffer with a very deep working directory plus a long relative path. None of these is reachable alone; each makes a separate overflow bug in LLVM or lld easier to exploit when compiling code you don't trust. On AArch64 itsprintffamily also read arguments from the wrong place, so text that LLVM formats could show stack contents or crash the compiler. Until v0.2.79, on x86-64 Linux the dynamic compiler asset (ablac-dynamic-x86_64-linux, built on glibc) avoids them; elsewhere, build code you don't trust from a shallow directory. Fixed in v0.2.79.
Bootstrap convergence
Two fresh Linux builders bootstrapped the source of v0.2.73 (23156facdb6fdab28c5b230290fa9758be8578fa) from different seeds and reached the same compiler:
- route A: v0.2.72 (
ablac-x86_64-linuxsha256a4f9c843f6cf4d00c914ff321d4abca1d82cff90d21f20839e9d50ad54c3f929) -> stage 1, 2, 3 - route B: v0.2.71 (sha256
e80eed4c65c9ea87f0cb4aef196e581dde1649407a3f1e6ccd849b577c38a69e) -> the sources of v0.2.72 (0d3c4b0903cf7f21966c23d5ba60fc0c622a013d), twice -> stage 1, 2, 3 - canonical IR (raw, non-debug, pre-prune
--emit-llvm src/orc_main.abat/build/source): sha256427e3fbf320b2ac7d0949102f585aad002c147a898847ca31ad1d9dda9ae8e26 - stage 2 executable
67a577c44242b7130d78e8dbde7c6fe743adfaf5ed37a9c5f5cf2af014e42883, object06602b7b266f8af6d24a176ec3bc95b6284d3084eced8f399bcfeb989b4a843f - toolchain: environment
d00897b2d6cc51118a9495656126ec6b32b87504a2eb780e173bac4eec54f68b, closureb1872f918c677d4b376f11826949774047bafeac6c208592b89a05f2dc4640aa - run: https://github.com/AndreBaltazar8/ablac/actions/runs/45652502485
This is route convergence within one compiler lineage: it is not an independent implementation, and it does not exclude a seed compromise shared by both routes (docs/bootstrap.md).