Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2038366imm; Mon, 16 Jul 2018 00:38:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddhbPzd3S5yfufGkheLnWlhS/0mDoCZL4K/ZvpRNxK24tret0jq1t1zv5zlFBVDw3Kv5nI X-Received: by 2002:a62:c1:: with SMTP id 184-v6mr17052093pfa.100.1531726730813; Mon, 16 Jul 2018 00:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726730; cv=none; d=google.com; s=arc-20160816; b=Bp1aTHAybItaclpEJS5h62T2dqhjiBuzWhYpI5q1AdHXfOCECfY0IeFC2oLSEXDSP4 Ohh3tYDk/30w6kVGvN0Dp/Hc2RnAbxLGllNWD62PE06KZjjyO667QZdAmaQAPNa8C2PV RU6kPu0C4ldJv7NZfHqHVWa4wGv8EJzmF8xTy4QlKKdEqshnRbTAg81UgInzIQmV/Xto PhGBb0iQazRq4i0l2wGcKA6NAednrW8XIob9MP8BNignlVXxKxg5PxuRnOvMyKqTYXjR eg1aGj/xnUZIg6CH6Gsjw8tHiUN1FEYzXfUmnQMg83ACjbl/al1wIYhkHECqBgsZ/73x cDgA== 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=WjIoo19B/WOWAFC8vNRKV2w1kwJpQkld4msTrlmotR8=; b=mnuR2uUlKHnWTta2QXQqmaZ1BKpkyUOZL8isCtelbcRe0vIWnW7W8Gub/9vu7b7nKS 4UB3zWVzsAvVCjK4krJBj81bcnGJ0i/w/pgAkOxNyUY9Pk+EnX9FWitjsXTM6JEVXHBd mnver199Y27M9j2959OTGhTesGedF+JVmCq5FULoNBKzHhNeFHAna9X7J75ArWD9O7FY vdNHb937NNnNYRKtTgKqswY+bdmg70uBsA9Iz+vcAC/c6bf4FL+Zf+ViY7CFPle4uGWh uobyqHbSbuwJp8MwhfjG34HTn+t6/6n8M2/nKerokE4EI507zHdoXwMdTMpbusNkXDCH aGTg== 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 l184-v6si28962470pge.257.2018.07.16.00.38.36; Mon, 16 Jul 2018 00:38:50 -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 S1731608AbeGPID2 (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46712 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeGPID1 (ORCPT ); Mon, 16 Jul 2018 04:03:27 -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 8B231CA1; Mon, 16 Jul 2018 07:37:26 +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.17 28/67] USB: serial: mos7840: fix status-register error handling Date: Mon, 16 Jul 2018 09:34:57 +0200 Message-Id: <20180716073447.561904520@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@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.17-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 @@ -468,6 +468,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;