mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dmitriy Chumachenko <Dmitry.Chumachenko@cyberprotect.ru>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	Oswald Buddenhagen <oswald.buddenhagen@gmx.de>,
	Mehul Rao <mehulrao@gmail.com>,
	Ji'an Zhou <eilaimemedsnaimel@gmail.com>,
	Norbert Szetei <norbert@doyensec.com>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<lvc-project@linuxtesting.org>
Subject: Re: [PATCH] ALSA: pcm: Don't WARN on NULL dma_area in the default mmap fault handler
Date: Sat, 31 Oct 2026 17:10:05 +0100	[thread overview]
Message-ID: <87pkwprgv6.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261030112502.22227-1-Dmitry.Chumachenko@cyberprotect.ru>

On Fri, 30 Oct 2026 12:25:02 +0100,
Dmitriy Chumachenko wrote:
> 
> During fuzz testing, the following issue was discovered.
> 
> WARNING: CPU: 2 PID: 1734 at sound/core/pcm_native.c:3835 
> snd_pcm_mmap_data_fault+0x47f/0x530 sound/core/pcm_native.c:3835
> 
> Modules linked in:
> CPU: 2 PID: 1734 Comm: syz.1.352 Not tainted 6.1.187-syzkaller-00593-g063a81552262 #0
> RIP: 0010:snd_pcm_mmap_data_fault+0x47f/0x530 sound/core/pcm_native.c:3835
> 
> Call Trace:
>  <TASK>
>  __do_fault+0x10d/0x480 mm/memory.c:4280
>  do_cow_fault mm/memory.c:4661 [inline]
>  do_fault+0xa7a/0x1100 mm/memory.c:4762
>  handle_pte_fault mm/memory.c:5031 [inline]
>  __handle_mm_fault+0xdf3/0x2e40 mm/memory.c:5173
>  handle_mm_fault+0x2da/0xa60 mm/memory.c:5294
>  do_user_addr_fault+0x4aa/0x1050 arch/x86/mm/fault.c:1338
>  handle_page_fault arch/x86/mm/fault.c:1429 [inline]
>  exc_page_fault+0x98/0x1b0 arch/x86/mm/fault.c:1482
>  asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
> 
> snd_pcm_mmap_data_fault() guards the default RAM-buffer path with
> WARN_ON_ONCE(!runtime->dma_area). As commit d2913a07d903 notes, a driver
> may allow mmap before dma_area is set up, so this state is reachable from
> user space: mmap the PCM data region and fault it while the buffer is not
> allocated. The WARN then fires on a user-triggerable path and panics a
> kernel with panic_on_warn.
> 
> Drop the WARN; the NULL check and VM_FAULT_SIGBUS return stay, which is
> the correct silent handling.
> 
> Fixes: d2913a07d903 ("ALSA: pcm: Add sanity NULL check for the default mmap fault handler")
> Signed-off-by: Dmitriy Chumachenko <Dmitry.Chumachenko@cyberprotect.ru>

The WARN_ON() was put there because it shouldn't happen, and dropping
WARN_ON() is likely an incorrect "solution".

Could you rather investigate how this is triggered (under which
condition with which driver)?  That should be addressed instead of
just silencing it.


thanks,

Takashi

      reply	other threads:[~2026-10-31 16:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 11:25 Dmitriy Chumachenko
2026-10-31 16:10 ` 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=87pkwprgv6.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Dmitry.Chumachenko@cyberprotect.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=eilaimemedsnaimel@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mehulrao@gmail.com \
    --cc=norbert@doyensec.com \
    --cc=oswald.buddenhagen@gmx.de \
    --cc=perex@perex.cz \
    --cc=sashal@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®