Skip to content

Comments

ggml-cpu: arm64: Fix wrong memcpy length for q4_K block_interleave == 4#19575

Merged
taronaeo merged 1 commit intoggml-org:masterfrom
Alcpz:Alcpz/q4_K_stack_smash
Feb 13, 2026
Merged

ggml-cpu: arm64: Fix wrong memcpy length for q4_K block_interleave == 4#19575
taronaeo merged 1 commit intoggml-org:masterfrom
Alcpz:Alcpz/q4_K_stack_smash

Conversation

@Alcpz
Copy link
Collaborator

@Alcpz Alcpz commented Feb 12, 2026

#19561 reports issues with the stack for Q4_K.
I can't reproduce the issue locally, but the make_block_q4_Kx8 function would write past the buffer size 4 extra bytes, which could be the issue.

@taronaeo, since you found the problem, are you able to check if this patch fixes it?

Q6_K and Q5_K (#19356, still opened at the moment this description was written) already address this problem.

@Alcpz Alcpz requested a review from ggerganov as a code owner February 12, 2026 19:34
@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Feb 13, 2026
@taronaeo taronaeo linked an issue Feb 13, 2026 that may be closed by this pull request
@taronaeo
Copy link
Collaborator

Yep I can confirm that this fixes the stack smashing problem. Thank you very much!

@taronaeo
Copy link
Collaborator

Merge on green? Your call :)

@Alcpz
Copy link
Collaborator Author

Alcpz commented Feb 13, 2026

Yeah, I can merge, but if you see it before I do, feel free to press the button :)

@taronaeo taronaeo merged commit cc2aa81 into ggml-org:master Feb 13, 2026
148 of 149 checks passed
@Alcpz Alcpz deleted the Alcpz/q4_K_stack_smash branch February 13, 2026 14:57
ronaldmannak pushed a commit to PicoMLX/llama.cpp that referenced this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: #17494 broke Q4_K repack, stack smashing detected

2 participants