Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2038335imm; Mon, 16 Jul 2018 00:38:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGodeFd4hQ0CZpVyV8xDUQcX9xx4YXydCSqOdxs+V8QbeSFrArQfi9hJdBqVWiTnfyfuwU X-Received: by 2002:a63:7b4d:: with SMTP id k13-v6mr14511199pgn.64.1531726728554; Mon, 16 Jul 2018 00:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726728; cv=none; d=google.com; s=arc-20160816; b=ySUyLZeyIZOrSQTjRNSldVt3EXi5mJ/uJOyV90m5Ujhh7pH26Dsz7tyFlFmKyr5fDW sAuoXqZEUFUmc4AZULT6QlxBbAHMwxVuovEsH+EiyofostwGj6PMKSqFjzh8BUekN7Bi mu04hAcA5Mbf5NcWznjexZecf3ytNYeOU5Za+YbRCR2iRp+eR0hqptAV2awEQL7ol8eb RkhgsIqtnDQo1BHnitnPzAjOgV9VFrEjkRRuPJhNXZN2oRnlLH9zfoN2GtH+O4LFiYO3 fj/xI4UNYNIAElTOVh9Jx3tQhpOyHwV+2QOsL07K/eEfxzMechxmbGc4HIvPjJ7/pceo MAVg== 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=N6TqHmCd1jRMt0pDPi5nbjMWnT5IUryUzKMP1g6/63A=; b=r3jqalEOohnRTL32CxRzsSaosZhwDhFOs9ljbrYYPeQeZhO4gTshDnM6S8QHuZwN4H ABt00DcfMjfXLgG4laUI53Iq9jRuV+qJoQaT/F3Vs+XpC4nHgjGl//7mr6ARwyFdxPY4 uQuymHSLAvzVmHuRsgBq8kfhycnWokdtCZB5RAh8LM2mWHGhPNB2cluYbjMMO2yj1FjA vMMnLwCcPTd58LBdLiS8tUatIghmNpblkQNJgXu/ap6GoUXd04cxwZ57g8vouJhJoPwU VoTzOd9JhGB49s5h9sD5Gpe0xJGV6Tpv9682Dkugty5K0lODDW9XFIlsZDC4v1G4Xucd txXw== 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 o20-v6si6108524pgh.319.2018.07.16.00.38.33; Mon, 16 Jul 2018 00:38:48 -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 S1731535AbeGPIDW (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46700 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeGPIDW (ORCPT ); Mon, 16 Jul 2018 04:03:22 -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 DFEEFCA0; Mon, 16 Jul 2018 07:37:20 +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 26/67] USB: serial: keyspan_pda: fix modem-status error handling Date: Mon, 16 Jul 2018 09:34:55 +0200 Message-Id: <20180716073447.271347846@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 01b3cdfca263a17554f7b249d20a247b2a751521 upstream. Fix broken modem-status error handling which could lead to bits of slab data leaking to user space. Fixes: 3b36a8fd6777 ("usb: fix uninitialized variable warning in keyspan_pda") Cc: stable # 2.6.27 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan_pda.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -369,8 +369,10 @@ static int keyspan_pda_get_modem_info(st 3, /* get pins */ USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_IN, 0, 0, data, 1, 2000); - if (rc >= 0) + if (rc == 1) *value = *data; + else if (rc >= 0) + rc = -EIO; kfree(data); return rc;