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] [day] [month] [year] [list]
Message-ID: <1jfsuvw817.fsf@starbuckisacylon.baylibre.com>
Date:   Fri, 27 Aug 2021 11:26:57 +0200
From:   Jerome Brunet <jbrunet@...libre.com>
To:     Felipe Balbi <balbi@...nel.org>
Cc:     Ruslan Bilovol <ruslan.bilovol@...il.com>,
        Pavel Hofman <pavel.hofman@...tera.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jack Pham <jackp@...eaurora.org>, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org,
        Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Ferry Toth <ftoth@...londelft.nl>
Subject: Re: [PATCH] usb: gadget: f_uac2: fixup feedback endpoint stop


On Fri 27 Aug 2021 at 11:05, Felipe Balbi <balbi@...nel.org> wrote:

> Hi,
>
> Jerome Brunet <jbrunet@...libre.com> writes:
>
>> When the uac2 function is stopped, there seems to be an issue reported on
>> some platforms (Intel Merrifield at least)
>>
>> BUG: kernel NULL pointer dereference, address: 0000000000000008
>> ...
>> RIP: 0010:dwc3_gadget_del_and_unmap_request+0x19/0xe0
>> ...
>> Call Trace:
>>  dwc3_remove_requests.constprop.0+0x12f/0x170
>>  __dwc3_gadget_ep_disable+0x7a/0x160
>>  dwc3_gadget_ep_disable+0x3d/0xd0
>>  usb_ep_disable+0x1c/0x70
>>  u_audio_stop_capture+0x79/0x120 [u_audio]
>>  afunc_set_alt+0x73/0x80 [usb_f_uac2]
>>  composite_setup+0x224/0x1b90 [libcomposite]
>>
>> The issue happens only when the gadget is using the sync type "async", not
>> "adaptive". This indicates that problem is coming from the feedback
>> endpoint, which is only used with async synchronization mode.
>>
>> The problem is that request is freed regardless of usb_ep_dequeue(), which
>> ends up badly if the request is not actually dequeued yet.
>>
>> Update the feedback endpoint free function to release the endpoint the same
>> way it is done for the data endpoint, which takes care of the problem.
>>
>> Reported-by: Ferry Toth <ftoth@...londelft.nl>
>> Tested-by: Ferry Toth <ftoth@...londelft.nl>
>> Signed-off-by: Jerome Brunet <jbrunet@...libre.com>
>> ---
>>  Hi Felipe,
>>
>>  This solves the issue reported here [0] and makes revert [1]
>>  unnecessary.
>
> awesome work! Thanks
>
> Acked-by: Felipe Balbi <balbi@...nel.org>

Forgot the fixes tag

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ