]> www.infradead.org Git - users/dwmw2/linux.git/commit
ALSA: pcm: oss: Fix a few more UBSAN fixes
authorTakashi Iwai <tiwai@suse.de>
Fri, 18 Dec 2020 16:17:30 +0000 (17:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:47:05 +0000 (13:47 +0100)
commite35c2215b09e2bd72b858cfeeffa40b3570a0860
treed0cdc8b37f9b4914d3ce3cba3a6bdf17cc7fcad2
parent7890a2677fea2ff58dcc7ac96cfdf95b78984db6
ALSA: pcm: oss: Fix a few more UBSAN fixes

commit 11cb881bf075cea41092a20236ba708b18e1dbb2 upstream.

There are a few places that call round{up|down}_pow_of_two() with the
value zero, and this causes undefined behavior warnings.  Avoid
calling those macros if such a nonsense value is passed; it's a minor
optimization as well, as we handle it as either an error or a value to
be skipped, instead.

Reported-by: syzbot+33ef0b6639a8d2d42b4c@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201218161730.26596-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/oss/pcm_oss.c