Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2043067imm; Mon, 16 Jul 2018 00:45:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe5tcB67p9BiqvwBBc7YCho8Zn81cnmdHXuWyc1jA5beL/eyiusC3rw9hdg+0ak7kgnxTgO X-Received: by 2002:a63:9619:: with SMTP id c25-v6mr8382775pge.75.1531727138607; Mon, 16 Jul 2018 00:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727138; cv=none; d=google.com; s=arc-20160816; b=gLADbplRPHwih/gCrlTOcgSdRzOd7efVARdOHJh7fg/5BYL/wxavk+HRfZ1G3NmvVE qwGZVPyxPHXOrXeG4Ms/buuHncXfw9UMSLfSrXFxeVN6BJCKado9Lbw4pEgDVst7vO0j /gSZGpKoYeh+VaNzR5HGVV0aNNzbxHBuktPzEbo8D9ie8gPCsF5NXmIcAM9F2TTLKIyV viFDZxls7lI23VkfKA+cNTwucMwFrIC/8QEAA5KSr9MrQCs0fY0OEkVMKJDsjGPKxxHO vds3XwGk2sRGKegEeSGZBnD2iZeEVmindacwCo1TyfHoYKmcgN2TjR+CNCj20aBFCniY wTzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=j3OrSPxDE/xVGk52f5E4s7x2stbH8ZmKe/iCCE+MZIs=; b=GSpjRU+STcDU0hMgEnlsgVIQyi+yKvZmg2mjA2wE356rgDGlZnpyHLROtxd0HWGEpB OSEAZfAJZxM/TtwfiV6AEDBG83j05feOhLTqxHwKS8J493OXvKnxQeoPScFstmVASyV0 T5rxc6sdUxRce/Yat81iTwy/Lhz3shAE7Itm7Kt9vkhJcR9YiacQCzj9P8Xidv6ncOG4 O153fegTJuoYGrvBdoZT3mc8FH68LVaRc+sA0AwFhd+68VRRkc/da3WNXk1OMx63TIfe Q0t/cYTGeu+Z4Jr95pAb0JOk0WrC7zYBr6n9xsSUQ24MuAcA5nDP6sLlXes8sNzlnWeN Jvdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si22536798pgy.118.2018.07.16.00.45.23; Mon, 16 Jul 2018 00:45:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389430AbeGPIKr (ORCPT + 99 others); Mon, 16 Jul 2018 04:10:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48246 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388522AbeGPIKq (ORCPT ); Mon, 16 Jul 2018 04:10:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2662CCA0; Mon, 16 Jul 2018 07:44:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.4 09/43] USB: serial: mos7840: fix status-register error handling Date: Mon, 16 Jul 2018 09:36:14 +0200 Message-Id: <20180716073512.783580283@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 794744abfffef8b1f3c0c8a4896177d6d13d653d upstream. Add missing transfer-length sanity check to the status-register completion handler to avoid leaking bits of uninitialised slab data to user space. Fixes: 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver") Cc: stable # 2.6.19 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/mos7840.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -482,6 +482,9 @@ static void mos7840_control_callback(str } dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); + if (urb->actual_length < 1) + goto out; + dev_dbg(dev, "%s mos7840_port->MsrLsr is %d port %d\n", __func__, mos7840_port->MsrLsr, mos7840_port->port_num); data = urb->transfer_buffer;