From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9011ECE599 for ; Wed, 16 Oct 2019 22:10:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A778D2168B for ; Wed, 16 Oct 2019 22:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263839; bh=lt385UfrJF89sF7JHdA5gMeIVFsDC8oOelDqQLBCJ0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Aug1UnUBxyCOCz0ipgVxd/a1Fn+VvAiUPtiL5CZXtmtW864DY4MDSRxRbEOjT3Q/E JufJc81/5969l8H2qs9o6krp4RCUunzZLDv2SEweFreo6GUGpJUSotGgAOF5YuD4uX 7YVbw+lB17a4d+Rt2CP48/wPXLYQ8Kd7gxp+aOPc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407237AbfJPWKi (ORCPT ); Wed, 16 Oct 2019 18:10:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:49606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437958AbfJPV5K (ORCPT ); Wed, 16 Oct 2019 17:57:10 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59F1721A4C; Wed, 16 Oct 2019 21:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263030; bh=lt385UfrJF89sF7JHdA5gMeIVFsDC8oOelDqQLBCJ0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVvq6luLrBvJLsZ08a7v4I4qAUmtcUErWPX3ceNd/yh0+1ETr5HaaFhO2T4iWaKwZ WdM3YEdW9P9PJtAFOjopArX7o3XwGULke0J62PYsdbwgpVlTMlt5+4keCS6pxz8Ln/ YpzMeqQocnEqKI2rpUCJ4QwpsCf/E8Sj6C31b5u4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+5630ca7c3b2be5c9da5e@syzkaller.appspotmail.com, Johan Hovold , Oliver Neukum Subject: [PATCH 4.19 31/81] USB: microtek: fix info-leak at probe Date: Wed, 16 Oct 2019 14:50:42 -0700 Message-Id: <20191016214833.347317046@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214805.727399379@linuxfoundation.org> References: <20191016214805.727399379@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 177238c3d47d54b2ed8f0da7a4290db492f4a057 upstream. Add missing bulk-in endpoint sanity check to prevent uninitialised stack data from being reported to the system log and used as endpoint addresses. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reported-by: syzbot+5630ca7c3b2be5c9da5e@syzkaller.appspotmail.com Signed-off-by: Johan Hovold Acked-by: Oliver Neukum Link: https://lore.kernel.org/r/20191003070931.17009-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/image/microtek.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -721,6 +721,10 @@ static int mts_usb_probe(struct usb_inte } + if (ep_in_current != &ep_in_set[2]) { + MTS_WARNING("couldn't find two input bulk endpoints. Bailing out.\n"); + return -ENODEV; + } if ( ep_out == -1 ) { MTS_WARNING( "couldn't find an output bulk endpoint. Bailing out.\n" );