From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FC4B42DFEC; Tue, 21 Jul 2026 22:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674388; cv=none; b=r06sn2yjGbpIWLSoh72f2eFbNUogDgBmnr78Acd/8HTAEiN7vdBPfhVzL0yLJG6mTIf859zBwIujp6ntDHTBUrlI/lfFMCL3PDMhBgNRzTw532XIL+35gI90FsJtgmFfTdC28tvXA5YMbBxEZx3Jcg3j3ttkn4QmdzKlihzfxNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674388; c=relaxed/simple; bh=7o6VuLp81WnvGaiqMFN2GlyuzKChwTR3+RfhO9kVlAA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OzXP9SXi2YeSrg04yyP8MLdmY18gdWhXDSPXxGAl3qpngoLNLW00TqJLY1lnl/hRkEKysWe3V37pTvtqVlDB+goeQ1zA/o4Yn+3yqfGUcEONU1FV/BRGBjayZMsj5/nCY6+XJao/Ph7QnG2QzaCk0RYWcyDwLGUR0NQSTi9m8SE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GwXSYCVW; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GwXSYCVW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 941761F00A3A; Tue, 21 Jul 2026 22:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784674387; bh=bWOSA7A7Tvam5KUjUUGcUczRponATCLbTiYQrI/wH3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GwXSYCVWlW2W8q9UAiN47R4D5ATEH/HKF7KfazhHni/MYIH/N3Fq6x0NWekQeHiL/ ZqIjUlA7N9TGMj4CwXGq1YYvpakBRfe+7iPQVuFnbxlseoikxQYWlVCIN1e4cdh2B3 E0YePh47P5UHRzqo2Mv6dSNsxP12WCYliCH7l7Ao= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko bot , Dmitry Torokhov Subject: [PATCH 5.10 522/699] Input: ims-pcu - fix DMA mapping violation in line setup Date: Tue, 21 Jul 2026 17:24:41 +0200 Message-ID: <20260721152407.470810977@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit 8adf4289d945e8990e4336436a97da71d21d2cae upstream. In ims_pcu_line_setup(), the driver uses pcu->cmd_buf as a transfer buffer for usb_control_msg(). However, pcu->cmd_buf is embedded in the struct ims_pcu allocation, which violates DMA mapping rules regarding cacheline alignment. Use a heap-allocated buffer for the line coding data instead. Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver") Cc: stable@vger.kernel.org Reported-by: Sashiko bot Assisted-by: Gemini:gemini-3.1-pro Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/misc/ims-pcu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -1808,11 +1808,16 @@ static void ims_pcu_stop_io(struct ims_p static int ims_pcu_line_setup(struct ims_pcu *pcu) { struct usb_host_interface *interface = pcu->ctrl_intf->cur_altsetting; - struct usb_cdc_line_coding *line = (void *)pcu->cmd_buf; + struct usb_cdc_line_coding *line __free(kfree) = + kmalloc(sizeof(*line), GFP_KERNEL); int error; - memset(line, 0, sizeof(*line)); + if (!line) + return -ENOMEM; + line->dwDTERate = cpu_to_le32(57600); + line->bCharFormat = USB_CDC_1_STOP_BITS; + line->bParityType = USB_CDC_NO_PARITY; line->bDataBits = 8; error = usb_control_msg(pcu->udev, usb_sndctrlpipe(pcu->udev, 0),