lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871pwl7evv.wl-tiwai@suse.de>
Date: Wed, 29 Jan 2025 17:40:04 +0100
From: Takashi Iwai <tiwai@...e.de>
To: John Keeping <jkeeping@...usicbrands.com>
Cc: linux-usb@...r.kernel.org,
	stable@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Kees Cook <kees@...nel.org>,
	Abdul Rahim <abdul.rahim@...ahoo.com>,
	Michael Grzeschik <m.grzeschik@...gutronix.de>,
	Jeff Johnson <quic_jjohnson@...cinc.com>,
	Felipe Balbi <balbi@...com>,
	Daniel Mack <zonque@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: f_midi: fix MIDI Streaming descriptor lengths

On Wed, 29 Jan 2025 17:05:19 +0100,
John Keeping wrote:
> 
> In the two loops before setting the MIDIStreaming descriptors,
> ms_in_desc.baAssocJackID[] has entries written for "in_ports" values and
> ms_out_desc.baAssocJackID[] has entries written for "out_ports" values.
> But the counts and lengths are set the other way round in the
> descriptors.
> 
> Fix the descriptors so that the bNumEmbMIDIJack values and the
> descriptor lengths match the number of entries populated in the trailing
> arrays.

Are you sure that it's a correct change?

IIUC, the in_ports and out_ports parameters are for external IN and
OUT jacks, where an external OUT jack is connected to an embedded IN
jack, and an external IN jack is connected to an embedded OUT jack.


thanks,

Takashi

> 
> Cc: stable@...r.kernel.org
> Fixes: c8933c3f79568 ("USB: gadget: f_midi: allow a dynamic number of input and output ports")
> Signed-off-by: John Keeping <jkeeping@...usicbrands.com>
> ---
>  drivers/usb/gadget/function/f_midi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
> index 837fcdfa3840f..6cc3d86cb4774 100644
> --- a/drivers/usb/gadget/function/f_midi.c
> +++ b/drivers/usb/gadget/function/f_midi.c
> @@ -1000,11 +1000,11 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f)
>  	}
>  
>  	/* configure the endpoint descriptors ... */
> -	ms_out_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->in_ports);
> -	ms_out_desc.bNumEmbMIDIJack = midi->in_ports;
> +	ms_out_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->out_ports);
> +	ms_out_desc.bNumEmbMIDIJack = midi->out_ports;
>  
> -	ms_in_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->out_ports);
> -	ms_in_desc.bNumEmbMIDIJack = midi->out_ports;
> +	ms_in_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->in_ports);
> +	ms_in_desc.bNumEmbMIDIJack = midi->in_ports;
>  
>  	/* ... and add them to the list */
>  	endpoint_descriptor_index = i;
> -- 
> 2.48.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ