linux_dsm_epyc7002/sound/core
Clemens Ladisch b406e6103b ALSA: pcm: fix delta calculation at boundary wraparound
In the cleanup of the hw_ptr update functions in 2.6.33, the calculation
of the delta value was changed to use the modulo operator to protect
against a negative difference due to the pointer wrapping around at the
boundary.

However, the ptr variables are unsigned, so a negative difference would
result in the two complement's value which has no relation to the actual
difference relative to the boundary; the result is typically some value
near LONG_MAX-boundary.  Furthermore, even if the modulo operation would
be done with signed types, the result of a negative dividend could be
negative.

The invalid delta value is then caught by the following checks, but this
means that the pointer update is ignored.

To fix this, use a range check as in the other pointer calculations.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-25 20:23:48 +02:00
..
oss
seq
control_compat.c
control.c
device.c
hrtimer.c
hwdep_compat.c
hwdep.c
info_oss.c
info.c
init.c
isadma.c
jack.c Merge branch 'topic/jack' into for-linus 2010-05-20 11:59:37 +02:00
Kconfig
Makefile
memalloc.c
memory.c
misc.c
pcm_compat.c
pcm_lib.c ALSA: pcm: fix delta calculation at boundary wraparound 2010-05-25 20:23:48 +02:00
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: pcm: fix the fix of the runtime->boundary calculation 2010-05-21 16:33:34 +02:00
pcm_timer.c
pcm.c PM QOS update 2010-05-10 23:08:19 +02:00
rawmidi_compat.c
rawmidi.c
rtctimer.c
sgbuf.c
sound_oss.c
sound.c
timer_compat.c
timer.c Merge branch 'topic/core-cleanup' into for-linus 2010-05-20 11:58:57 +02:00
vmaster.c