mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Bruno Produit <bruno.produit@trailofbits.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Kyle Zeng <kylebot@openai.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dominik Czarnota <dominik.czarnota@trailofbits.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: seq: Serialize compat port-info ioctls
Date: Thu, 17 Sep 2026 14:36:15 +0200	[thread overview]
Message-ID: <87pkycgim8.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260917105643.90102-1-bruno.produit@trailofbits.com>

On Thu, 17 Sep 2026 12:56:43 +0200,
Bruno Produit wrote:
> 
> From: Kyle Zeng <kylebot@openai.com>
> 
> The native sequencer ioctl path serializes handler calls with
> client->ioctl_mutex, but the translated port-info compat path invokes the
> same handlers through snd_seq_kernel_client_ctl() without taking that
> mutex.
> 
> This lets concurrent compat CREATE_PORT requests pass the port-count
> check before any request reaches the serialized insertion. The computed
> integer port index can then exceed the address field range and wrap to an
> existing index. Subsequent subscriber teardown can resolve the duplicate
> address to the wrong port and access a freed subscriber.
> 
> Take ioctl_mutex while dispatching converted port-info requests, matching
> the native ioctl path. All translated port-info commands share this
> helper, so their accesses to the client port state are serialized as
> well.
> 
> Fixes: b3defb791b26 ("ALSA: seq: Make ioctls race-free")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:gpt-5.6-sol gpt-6-astra
> Signed-off-by: Kyle Zeng <kylebot@openai.com>
> Signed-off-by: Bruno Produit <bruno.produit@trailofbits.com>
> ---
> 
> Trail of Bits has a reproducer for this bug that triggers a
> KASAN use-after-free and can it share if needed

The bug looks obvious, a long-standing oversight.
Applied now.


thanks,

Takashi

      reply	other threads:[~2026-09-17 12:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 10:56 Bruno Produit
2026-09-17 12:36 ` 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=87pkycgim8.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=bruno.produit@trailofbits.com \
    --cc=dominik.czarnota@trailofbits.com \
    --cc=kylebot@openai.com \
    --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

all inboxes | Powered by JetHome®