ALSA: timer: Reject user params with too small ticks
authorTakashi Iwai <tiwai@suse.de>
Tue, 28 Feb 2017 13:49:07 +0000 (14:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:03:13 +0000 (14:03 +0200)
commit7a3085a36da3ee4b6b53c9f86d5186aec1caba64
tree06a68891bbda7b1b2dce223808cf4444ee57829c
parent28567fb4bc02fc0fdb7fd328cddfcd623f5dc65c
ALSA: timer: Reject user params with too small ticks

commit 71321eb3f2d0df4e6c327e0b936eec4458a12054 upstream.

When a user sets a too small ticks with a fine-grained timer like
hrtimer, the kernel tries to fire up the timer irq too frequently.
This may lead to the condensed locks, eventually the kernel spinlock
lockup with warnings.

For avoiding such a situation, we define a lower limit of the
resolution, namely 1ms.  When the user passes a too small tick value
that results in less than that, the kernel returns -EINVAL now.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
sound/core/timer.c