提交 #1050821: SqueezeAILab SqueezeLLM main Out-of-bounds write信息

标题SqueezeAILab SqueezeLLM main Out-of-bounds write
描述SqueezeLLM's dense-and-sparse CUDA matvec kernel writes out of bounds when it processes a crafted checkpoint. A SqueezeLLM checkpoint ships a full_row_indices int32 buffer of shape (topX,) (topX defaults to num_dense_channels = 10), loaded verbatim as a registered buffer. The kernel vecquant4matmul_spmv_hybrid_nuq_perchannel performs atomicAdd(&mul[full_row_indices[col]], value) using the checkpoint's index value with no bound check; the only guard in the kernel (threadIdx.x < width) bounds the thread, not the index. load_state_dict shape-checks that topX matches but never validates the index values, and loading uses torch.load, which on modern torch (>= 2.6, weights_only=True by default; the witness ran torch 2.13) loads a plain int32 tensor as data, so the issue is a genuine memory-safety bug and not merely subsumed by pickle deserialization. A full_row_indices value outside the output-row range causes an out-of-bounds GPU write via atomicAdd into adjacent memory, a memory-corruption primitive. Confirmed on an NVIDIA A100 with compute-sanitizer (control clean, crafted index -> out-of-bounds write). Requires loading and running an untrusted checkpoint; not reachable with a legitimate model. A secondary out-of-bounds read exists in the same kernel's CSR handling (SPMV_ATOMIC, unchecked rows/cols). Fix: bound full_row_indices (and the CSR row/col indices) against the output row count at load and/or in the kernel.
来源⚠️ https://github.com/SqueezeAILab/SqueezeLLM/issues/77
用户
 m00dy (UID 97162)
提交2026-10-21 23時17分 (1 月前)
管理2026-11-20 08時23分 (29 days later)
状态已接受
VulDB条目441203 [SqueezeAILab SqueezeLLM 直到 a5fd71f353bf569feb7b55737c1c1493e78e8f31 CUDA Matvec Kernel quant_cuda_kernel.cu vecquant4matmul_spmv_hybrid_nuq_perchannel full_row_indices 内存损坏]
积分20

Do you know our Splunk app?

Download it now for free!