Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042497imm; Mon, 16 Jul 2018 00:44:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfDKRz8T7DfoWWc56mA7VFp6UVHh9+TpJgrTNixVX9uWoYD81ZI1i+EuNaBZKu5wpngBD53 X-Received: by 2002:a62:15c8:: with SMTP id 191-v6mr16802650pfv.194.1531727093304; Mon, 16 Jul 2018 00:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727093; cv=none; d=google.com; s=arc-20160816; b=gdESvN+Nr8edtL1FS65CD0aVUfnIZLRyacIr8D/MozwT5q+MzngqhAIeK+IvaZ1KRA x9lIkox/+hCGyjCDuYThPIWaBgGzEUry8xmFMXPHoxb50TGUFlzxeWh14x7FYoQDWEO5 RPfLGU4+uWXHC+yRPU+lhZ9mcEgKwfXr3HQjSO70xkuo6Cfdr4qwPIQU64uW7bX8MGS7 rGog/JUCEWTeHrBKeCTVXm9+F8rbOBgwLhBMXCjqGRMOHToFL/bfsa3VGUZIeMS4m/q8 FgnAV2ofWLFgLJJApRNVOG1EQkE/dpbgd/KdhOZmkAfZXpJF6LwhwAJ5ph0SAcwOjsfD 4zvg== 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=tmePsXvedWTYV5IoUs9tIp0sbYFh4k8n1COIVAnSi6g=; b=rFOn7LmX63CWv2s9lNIiWCkPTRU0uMe96zkdrGeiVailxiSBc88Y11/eVJa8XJ5MSk JZ9xWAPBYjD//+kCTaxmmnrf4O9TBl6/2eEHr9X9iFFtWj6Xr5HA/QfErVUp3x9h0eSZ IHTIp0+5NPMPA4kMfi0GIpkwI42fSXehKgp4ufIZnB/VT7dzlk42makU1pAjgfo0ImDZ nx7NjOKxShKqii4fvuWTGmLQ/Hdb8xcPi5MQqcg1ZwJN4IY91CNy2mGDbvCGjlK2t4JD hyarL37T+kG6t76Cp284UGlABT5L0B+SGj7XeCaR9rVU+gKfdhm7Sx16sQSnn/ifGScW oN5g== 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 w22-v6si28914727plp.294.2018.07.16.00.44.37; Mon, 16 Jul 2018 00:44:53 -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 S2389033AbeGPIJ2 (ORCPT + 99 others); Mon, 16 Jul 2018 04:09:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48002 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIJ2 (ORCPT ); Mon, 16 Jul 2018 04:09:28 -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 1D80AC03; Mon, 16 Jul 2018 07:43:24 +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.9 13/32] USB: serial: keyspan_pda: fix modem-status error handling Date: Mon, 16 Jul 2018 09:36:21 +0200 Message-Id: <20180716073505.993553231@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@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.9-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 @@ -373,8 +373,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;