Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp64054ybl; Thu, 22 Aug 2019 19:53:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQsipJJYMgvWlm2Bf0XtMtAPTPpnq9yZhpdhmkVlfxHuW95Jg1ZXTWEAGsmYbG8O+epfGi X-Received: by 2002:a17:90a:e2ca:: with SMTP id fr10mr3001180pjb.72.1566528826803; Thu, 22 Aug 2019 19:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566528826; cv=none; d=google.com; s=arc-20160816; b=gxC76rzFNQwFAYVXXI0pBTv0Y6oPMpq9QB9nSTl2s9HeRzerwGPpojEPYuEsyqR1dB qktHszJmhn280uHPbYhT8R0aTvLOFhsHbeUhY9QhrcQ80qkKWa8/36fMMN+yMb6UAFQb BNGDu6XCtIvidO2o18nRBcw8M8Uj+BVHkYhtqQkDa+Qi39a1QrUffB2sp2VUDFTnJms1 y7Pu+odUpJmom22QNNKuhsjqBs/HfObNkrkb/9GbjuJV9QlMENWFt0y2yGx64BCRn2lr hcqrI5watWcbgYy9osezAI9A2sfjO9NpvbitR+zxXve8ryJs0MMudKOnNsogtcbb44mb Uu1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u28X5GS0LsVWNVk+5t+LlqstAb9IP5//6R21S+DufzQ=; b=YTM/SUWL+evtfvRrPkJdzrom5xRbpFCLmvSyvb8Tj37IV67QIJk2awpUnCHX3ZRFh9 L/pkr95GPG/O1xzdkqGDn4otLbY2ySPzFKMGvLb5HpVHRVs6WeK1zL2ZBwqrYXt3lCuY ELB3rQvmGJQnnGC7g3TNeeKc1GqaPUiJRhS5EbpOsX+VjPdGj57vd1XuQmFq4kGZFEbi RjvUNrUnaYOsHhvLwRvhv3lFl40VCIn7KI+lqrNl2eDnRboX16/tp7/n9rZP/4XBHwBa C+v83OX0NwAY7RL/X+e8yx9LOS5wWBNSHXiOG4pACW4RPsdHHvPLrkdIFpc6MOT0wrsQ dw2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GAjsXIId; 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 f5si1135034pln.228.2019.08.22.19.53.31; Thu, 22 Aug 2019 19:53:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=GAjsXIId; 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 S2392197AbfHVRbE (ORCPT + 99 others); Thu, 22 Aug 2019 13:31:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:50850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404569AbfHVR0B (ORCPT ); Thu, 22 Aug 2019 13:26:01 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (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 B9EC12341E; Thu, 22 Aug 2019 17:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494760; bh=vSAa9ldWykU4vJubWpUyXhNCl9OsKu/vpNTRZRlXdzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAjsXIIdB2Ffeezb2dzMS9Vqa5PfyQzb5gEQyqZQKeD54N8o6SXl/oODKlD9RBc8T hxmtoIGvqfupdANHj+88q0bfvAsFYfnKsGByxFoKXgIaL2SSGP1BmVP016XY29RRus oVuus1ZF4mBvBMrOm9UmpQQf+cciTRU0XCz34wg0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+45a53506b65321c1fe91@syzkaller.appspotmail.com, Oliver Neukum Subject: [PATCH 4.19 62/85] USB: CDC: fix sanity checks in CDC union parser Date: Thu, 22 Aug 2019 10:19:35 -0700 Message-Id: <20190822171733.916043761@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171731.012687054@linuxfoundation.org> References: <20190822171731.012687054@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: Oliver Neukum commit 54364278fb3cabdea51d6398b07c87415065b3fc upstream. A few checks checked for the size of the pointer to a structure instead of the structure itself. Copy & paste issue presumably. Fixes: e4c6fb7794982 ("usbnet: move the CDC parser into USB core") Cc: stable Reported-by: syzbot+45a53506b65321c1fe91@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20190813093541.18889-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/message.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -2211,14 +2211,14 @@ int cdc_parse_cdc_header(struct usb_cdc_ (struct usb_cdc_dmm_desc *)buffer; break; case USB_CDC_MDLM_TYPE: - if (elength < sizeof(struct usb_cdc_mdlm_desc *)) + if (elength < sizeof(struct usb_cdc_mdlm_desc)) goto next_desc; if (desc) return -EINVAL; desc = (struct usb_cdc_mdlm_desc *)buffer; break; case USB_CDC_MDLM_DETAIL_TYPE: - if (elength < sizeof(struct usb_cdc_mdlm_detail_desc *)) + if (elength < sizeof(struct usb_cdc_mdlm_detail_desc)) goto next_desc; if (detail) return -EINVAL;