mbox series

[BlueZ,0/1] Fix SDP buffer overflow for DS4 (Revision 2)

Message ID 20241219181140.423916-1-kieran.r.geary@gmail.com
Headers show
Series Fix SDP buffer overflow for DS4 (Revision 2) | expand

Message

Kieran Geary Dec. 19, 2024, 6:11 p.m. UTC
Hello,

I have a Dualshock 4 that has been unable to connect via BlueZ, since it reports a L2CAP buffer overflow when it recieves an SDP response on PSM19. This is known for Dualshock 4 (Revision 1) controllers , and there is already a fix in place for it in BlueZ. This patch extends that fix to also apply for the Revision 2 product code.


If there are any adjustments that need to be made, feel free to reach out.

Many thanks,
Kieran Geary

Kieran Geary (1):
  Set `SDP_LARGE_MTU` flag for DS4 Rev. 2 product code

 src/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luiz Augusto von Dentz Dec. 19, 2024, 6:59 p.m. UTC | #1
Hi Kieran,

On Thu, Dec 19, 2024 at 1:13 PM Kieran Geary <kieran.r.geary@gmail.com> wrote:
>
> ---
>  src/device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index 2b3d19f55..4e5a5b945 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -6047,7 +6047,7 @@ static uint16_t get_sdp_flags(struct btd_device *device)
>          * results in SDP response being dropped by kernel. Workaround this by
>          * forcing SDP code to use bigger MTU while connecting.
>          */
> -       if (vid == 0x054c && pid == 0x05c4)
> +       if (vid == 0x054c && (pid == 0x05c4 || pid == 0x09cc))
>                 return SDP_LARGE_MTU;
>
>         if (btd_adapter_ssp_enabled(device->adapter))
> --
> 2.47.1

Perhaps it would be a good idea to create a vid:pid table if there are
multiple devices being affected.