Re: [PATCH] ALSA: FCP: avoid leaking uninitialized heap memory in fcp_ioctl_cmd()
From: Takashi Iwai
Date: Tue Dec 01 2026 - 02:48:54 EST
On Mon, 30 Nov 2026 11:33:01 +0100,
Ziheng Wei wrote:
>
> fcp_ioctl_cmd() allocates the request/response buffer with kmalloc(). If
> userspace invokes FCP_IOCTL_CMD with opcode == FCP_USB_REBOOT,
> req_size == 0, and resp_size > 0 (up to 4096 bytes), fcp_usb() returns 0
> early on -ESHUTDOWN or -EPROTO without writing resp_data, and
> fcp_ioctl_cmd() copies uninitialized heap memory back to userspace.
>
> Allocate the buffer with kzalloc() and zero resp_data on the early-return
> path in fcp_usb().
>
> Found by LLM-assisted static analysis and compile-tested on x86_64.
>
> Fixes: 46757a3e7d50 ("ALSA: FCP: Add Focusrite Control Protocol driver")
> Signed-off-by: Ziheng Wei <zihengw03@xxxxxxx>
Applied now. Thanks.
Takashi