All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Andrey Shumilin <shum.sdl@nppct.ru>
Cc: Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, lvc-project@linuxtesting.org,
	lvc-patches@linuxtesting.org, khoroshilov@ispras.ru,
	ykarpov@ispras.ru, vmerzlyakov@ispras.ru, vefanov@ispras.ru
Subject: Re: [PATCH] ALSA: firewire-lib: Avoid division by zero in apply_constraint_to_size()
Date: Mon, 21 Oct 2024 07:05:23 +0900	[thread overview]
Message-ID: <20241020220523.GA10241@workstation.local> (raw)
In-Reply-To: <20241018060018.1189537-1-shum.sdl@nppct.ru>

Hi,

On Fri, Oct 18, 2024 at 09:00:18AM +0300, Andrey Shumilin wrote:
> The step variable is initialized to zero. It is changed in the loop,
> but if it's not changed it will remain zero. Add a variable check
> before the division.
> 
> The observed behavior was introduced by commit 826b5de90c0b
> ("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size"),
> and it is difficult to show that any of the interval parameters will
> satisfy the snd_interval_test() condition with data from the
> amdtp_rate_table[] table.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 826b5de90c0b ("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size")
> Signed-off-by: Andrey Shumilin <shum.sdl@nppct.ru>
> ---
>  sound/firewire/amdtp-stream.c | 3 +++
>  1 file changed, 3 insertions(+)

I think it a good catch.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>


Regards

Takashi Sakamoto

  reply	other threads:[~2024-10-20 22:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  6:00 [PATCH] ALSA: firewire-lib: Avoid division by zero in apply_constraint_to_size() Andrey Shumilin
2024-10-20 22:05 ` Takashi Sakamoto [this message]
2024-10-21  7:09 ` Takashi Iwai

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=20241020220523.GA10241@workstation.local \
    --to=o-takashi@sakamocchi.jp \
    --cc=khoroshilov@ispras.ru \
    --cc=linux-sound@vger.kernel.org \
    --cc=lvc-patches@linuxtesting.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=shum.sdl@nppct.ru \
    --cc=tiwai@suse.com \
    --cc=vefanov@ispras.ru \
    --cc=vmerzlyakov@ispras.ru \
    --cc=ykarpov@ispras.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.