Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb367905 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: f_gsi: Use required RNDIS IAD descriptors with full speed descriptors



gsi_eth_fs_function is array of pointers to set of RNDIS interface
related descriptors. gsi_eth_fs_function's first descriptor is
pointing itself instead of required RNDIS IAD descriptor. This
results into out-of-bound read access while copying these set of
descriptors with usb_copy_descriptors() API. Fix this issue by
using required RNDIS IAD descriptor here.

Change-Id: Ic604221febc43eb8a22d8de99fb8cead74e13b41
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent f38ea00b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.

 * Copyright (c) 2015-2016, 2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
@@ -519,7 +519,7 @@ static struct usb_endpoint_descriptor rndis_gsi_fs_out_desc = {
};

static struct usb_descriptor_header *gsi_eth_fs_function[] = {
	(struct usb_descriptor_header *) &gsi_eth_fs_function,
	(struct usb_descriptor_header *) &rndis_gsi_iad_descriptor,
	/* control interface matches ACM, not Ethernet */
	(struct usb_descriptor_header *) &rndis_gsi_control_intf,
	(struct usb_descriptor_header *) &rndis_gsi_header_desc,