Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042897imm; Mon, 16 Jul 2018 00:45:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcibcg1Lseq1uK4q26HKfYsXzcOZWdbuvQYzHcplGed82j45FnzaIA4b3u0KRwFnucNXt12 X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr14131700pgd.291.1531727125382; Mon, 16 Jul 2018 00:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727125; cv=none; d=google.com; s=arc-20160816; b=V2RHIBHx7zdvHoXLxawwzWSFk+Z0PXikQax00+gm5QcCFAmtYfchj9yhEho+SRHrgq J1yZNf8VsaihT6/UVwPJQOjx64B4HMz7TCRvawI4lgrNwIspI6z4bQhfMNYwSTYnzgjl tUKHsm9VIXlb3ez7RWBn4dKWCOYIDscowNl4QSeftDaRdsUb+hBY/HiP1oJ0KJ0weyKF 3LEFJi+dwT2PrX3hpT5IQTPY2GxHA2e1USp4tAOjPMFVFonQGbuynKpbRe4alxiKmTeQ 4P+Oshj2J63gGCToyIIs67nLcMhX21nTprYTOH/ympvk6pXflfdhExEHO6Cz8J+9NBwR KPPQ== 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=coIdkTgK/2Zrt6IBiNA5xSgpCosEeV+1JOSDVD/EiOU=; b=Sm2Np8R1pNkrWlRBbQ0iw6b/iw3h1FNuHuJHV4JCVhefEtUT35m0aD+WwNIIFf+rx5 7Pq9HVuDu8aFO+1v6X5DFB5J0kNpeORa5u2XRjwrVXE2mpedqspNkiLlSmapPZMtM3Dx 8siblhhEkFb5ZM3PJmu2qrbzWcwIdkNlmXnf72QPlgcUhkMXzJ7SwJc7ywH8nKwV1BMK H3hOPRpULpZjqF3d68M5z5oK1aQjIN5ofCxu/CMp3bD/e4C6dm8syU0Rm2JpvGo4e1Qp fT2kgvcLJ8lYuvRT2iJ5+XlpC/ikB8skzeAKh4XGFSPEXSGt9xAxxIm6WU1iOq3kh/YO 6FeQ== 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 b2-v6si4358546plk.111.2018.07.16.00.45.10; Mon, 16 Jul 2018 00:45:25 -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 S2389404AbeGPIKl (ORCPT + 99 others); Mon, 16 Jul 2018 04:10:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48234 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388522AbeGPIKl (ORCPT ); Mon, 16 Jul 2018 04:10:41 -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 C101CCA0; Mon, 16 Jul 2018 07:44:37 +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 07/43] USB: serial: keyspan_pda: fix modem-status error handling Date: Mon, 16 Jul 2018 09:36:12 +0200 Message-Id: <20180716073512.561839542@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 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;