Skip to content
HN On Hacker News ↗

8392044: AVX-512 Base64 decoder overwrites output buffer on short padded tail by albertnetymk · Pull Request #32781 · openjdk/jdk

▲ 462 points • 138 comments • by notmine1337 • 4d ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this text is a mix of AI and human-written content.

23 %

AI likelihood · overall

Mixed
77% human-written 23% AI-generated
SEGMENTS · HUMAN 3 of 6
SEGMENTS · AI 3 of 6
WORD COUNT 231
PEAK AI % 100% · §2
Analyzed
Nov 19
backend: pangram/v3.3
Segments scanned
6 windows
avg 39 words each
Distribution
77 / 23%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 231 words · 6 segments analyzed

Human AI-generated
§1 Human · 0%

In StubGenerator::generate_base64_decodeBlock() (x86_64 AVX-512 VBMI path), L_finalBit handles 1-63 leftover bytes with a masked vector sequence that computes output_size = (len/4)*3.

§2 AI · 100%

Valid inputs always have a length multiple of 4, so this bug triggers only on invalid inputs: with length < 4 (e.g.

§3 AI · 100%

"A".repeat(64)+"=" leaves 1 byte after L_process64Loop), output_size starts at 0 and the padding path decrements it below zero, producing a wrong output_mask.

§4 AI · 87%

The stub stores past the logical output length before returning to Java, corrupting the heap.

§5 Human · 0%

The suggested fix is to early-return to Java if length < 4.

§6 Human · 0%

I confirm that I make this contribution in accordance with the OpenJDK Interim AI Policy. Progress Change must not contain extraneous whitespace Commit message must refer to an issue Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author) Integration blocker ⚠ Failed to retrieve information on issue 8392044. Please make sure it exists and is accessible. Issue ⚠ Failed to retrieve information on issue 8392044. Reviewing Using git Checkout this PR locally: $ git fetch https://git.openjdk.org/jdk.git pull/32781/head:pull/32781 $ git checkout pull/32781 Update a local copy of the PR: $ git checkout pull/32781 $ git pull https://git.openjdk.org/jdk.git pull/32781/head Using Skara CLI tools Checkout this PR locally: $ git pr checkout 32781 View PR using the GUI difftool: $ git pr show -t 32781 Using diff file Download this PR as a diff file: https://git.openjdk.org/jdk/pull/32781.diff