Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Darvell Long <contact@darvell.me>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: avoid kobject path lookup in DualSense match
Date: Thu, 25 Jun 2026 13:52:53 +0200	[thread overview]
Message-ID: <87bjcyvnu2.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260624143723.2986353-1-contact@darvell.me>

On Wed, 24 Jun 2026 16:37:23 +0200,
Darvell Long wrote:
> 
> The DualSense jack-detection input handler verifies that a matching input
> device belongs to the same physical controller by building kobject path
> strings for both the input device and the USB audio device, then comparing
> the path prefix.
> 
> This was observed when a weak physical connection caused the controller
> to rapidly disconnect and reconnect. During that repeated hotplug,
> snd_dualsense_ih_match() can run while the controller's USB device is
> being disconnected. kobject_get_path() walks ancestor kobjects and
> dereferences their names; if the USB device kobject name is no longer
> valid, this can fault in strlen():
> 
>   RIP: 0010:strlen+0x10/0x30
>   Call Trace:
>    kobject_get_path+0x34/0x150
>    snd_dualsense_ih_match+0x49/0xd0 [snd_usb_audio]
>    input_register_device+0x566/0x6a0
>    ps_probe+0xb89/0x1590 [hid_playstation]
> 
> The same ownership check can be done without building kobject path
> strings. The input device is parented below the HID device, USB interface
> and USB device, so walking the input device parent chain and comparing
> against the mixer USB device preserves the check without dereferencing
> kobject names during disconnect.
> 
> Fixes: 79d561c4ec04 ("ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5")
> Cc: <stable@vger.kernel.org>
> Assisted-by: Cute:gpt-5.5
> Signed-off-by: Darvell Long <contact@darvell.me>

Thanks, applied now.


Takashi

      reply	other threads:[~2026-06-25 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 14:37 [PATCH] ALSA: usb-audio: avoid kobject path lookup in DualSense match Darvell Long
2026-06-25 11:52 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bjcyvnu2.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=contact@darvell.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox