<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core/timer.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-05-30T07:44:03Z</updated>
<entry>
<title>ALSA: timer: Set lower bound of start tick time</title>
<updated>2024-05-30T07:44:03Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2024-05-14T18:27:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=abb1ad69d98cf1ff25bb14fff0e7c3f66239e1cd'/>
<id>urn:sha1:abb1ad69d98cf1ff25bb14fff0e7c3f66239e1cd</id>
<content type='text'>
commit 4a63bd179fa8d3fcc44a0d9d71d941ddd62f0c4e upstream.

Currently ALSA timer doesn't have the lower limit of the start tick
time, and it allows a very small size, e.g. 1 tick with 1ns resolution
for hrtimer.  Such a situation may lead to an unexpected RCU stall,
where  the callback repeatedly queuing the expire update, as reported
by fuzzer.

This patch introduces a sanity check of the timer start tick time, so
that the system returns an error when a too small start size is set.
As of this patch, the lower limit is hard-coded to 100us, which is
small enough but can still work somehow.

Reported-by: syzbot+43120c2af6ca2938cc38@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/000000000000fa00a1061740ab6d@google.com
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20240514182745.4015-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Fix missing irq-disable at closing</title>
<updated>2024-03-15T10:16:47Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2024-03-15T10:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=587d67fd929ad89801bcc429675bda90d53f6592'/>
<id>urn:sha1:587d67fd929ad89801bcc429675bda90d53f6592</id>
<content type='text'>
The conversion to guard macro dropped the irq-disablement at closing
mistakenly, which may lead to a race.  Fix it.

Fixes: beb45974dd49 ("ALSA: timer: Use guard() for locking")
Reported-by: syzbot+28c1a5a5b041a754b947@syzkaller.appspotmail.com
Closes: http://lore.kernel.org/r/0000000000000b9a510613b0145f@google.com
Message-ID: &lt;20240315101447.18395-1-tiwai@suse.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Use guard() for locking</title>
<updated>2024-02-28T14:01:20Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2024-02-27T08:52:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=beb45974dd49068b24788bbfc2abe20d50503761'/>
<id>urn:sha1:beb45974dd49068b24788bbfc2abe20d50503761</id>
<content type='text'>
We can simplify the code gracefully with new guard() macro and co for
automatic cleanup of locks.

For making changes easier, some functions widen the application of
register_mutex, but those shouldn't influence on any actual
performance.

Also, one code block was factored out as a function so that guard()
can be applied cleanly without much indentation.

There are still a few remaining explicit spin_lock/unlock calls, and
those are for the places where we do temporary unlock/relock, which
doesn't fit well with the guard(), so far.

Only the code refactoring, and no functional changes.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://lore.kernel.org/r/20240227085306.9764-4-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: timer: Use automatic cleanup of kfree()</title>
<updated>2024-02-23T09:57:30Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2024-02-22T11:15:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed96f6394e1bf44ae03327683f2970302f431320'/>
<id>urn:sha1:ed96f6394e1bf44ae03327683f2970302f431320</id>
<content type='text'>
There are common patterns where a temporary buffer is allocated and
freed at the exit, and those can be simplified with the recent cleanup
mechanism via __free(kfree).

No functional changes, only code refactoring.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://lore.kernel.org/r/20240222111509.28390-5-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: timer: Create device with snd_device_alloc()</title>
<updated>2023-08-17T07:24:21Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2023-08-16T16:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=911fcb76e39e3b85507bae7ccf78af7fc09acdb8'/>
<id>urn:sha1:911fcb76e39e3b85507bae7ccf78af7fc09acdb8</id>
<content type='text'>
Align with the other components, and use snd_device_alloc() for the
new sound device for timer, too.  No functional changes.

Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Tested-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20230816160252.23396-8-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: minimize open-coded access to hw.resolution</title>
<updated>2023-06-13T05:43:38Z</updated>
<author>
<name>Oswald Buddenhagen</name>
</author>
<published>2023-06-12T19:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6cc844504638b0d1429be729b2d66be92276e24b'/>
<id>urn:sha1:6cc844504638b0d1429be729b2d66be92276e24b</id>
<content type='text'>
Some info-querying code still used hw.resolution directly instead of
calling snd_timer_hw_resolution(), thus missing a possible
hw.c_resolution callback. This patch rectifies that.

Signed-off-by: Oswald Buddenhagen &lt;oswald.buddenhagen@gmx.de&gt;
Link: https://lore.kernel.org/r/20230612191325.1315854-7-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Use deferred fasync helper</title>
<updated>2022-07-29T10:57:11Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2022-07-28T12:59:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=95cc637c1afd83fb7dd3d7c8a53710488f4caf9c'/>
<id>urn:sha1:95cc637c1afd83fb7dd3d7c8a53710488f4caf9c</id>
<content type='text'>
For avoiding the potential deadlock via kill_fasync() call, use the
new fasync helpers to defer the invocation from PCI API.  Note that
it's merely a workaround.

Reported-by: syzbot+1ee0910eca9c94f71f25@syzkaller.appspotmail.com
Reported-by: syzbot+49b10793b867871ee26f@syzkaller.appspotmail.com
Reported-by: syzbot+8285e973a41b5aa68902@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20220728125945.29533-3-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Unconditionally unlink slave instances, too</title>
<updated>2021-11-05T10:27:27Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2021-11-05T09:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffdd98277f0a1d15a67a74ae09bee713df4c0dbc'/>
<id>urn:sha1:ffdd98277f0a1d15a67a74ae09bee713df4c0dbc</id>
<content type='text'>
Like the previous fix (commit c0317c0e8709 "ALSA: timer: Fix
use-after-free problem"), we have to unlink slave timer instances
immediately at snd_timer_stop(), too.  Otherwise it may leave a stale
entry in the list if the slave instance is freed before actually
running.

Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20211105091517.21733-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Fix use-after-free problem</title>
<updated>2021-11-03T15:52:13Z</updated>
<author>
<name>Wang Wensheng</name>
</author>
<published>2021-11-03T03:35:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0317c0e87094f5b5782b6fdef5ae0a4b150496c'/>
<id>urn:sha1:c0317c0e87094f5b5782b6fdef5ae0a4b150496c</id>
<content type='text'>
When the timer instance was add into ack_list but was not currently in
process, the user could stop it via snd_timer_stop1() without delete it
from the ack_list. Then the user could free the timer instance and when
it was actually processed UAF occurred.

This issue could be reproduced via testcase snd_timer01 in ltp - running
several instances of that testcase at the same time.

What I actually met was that the ack_list of the timer broken and the
kernel went into deadloop with irqoff. That could be detected by
hardlockup detector on board or when we run it on qemu, we could use gdb
to dump the ack_list when the console has no response.

To fix this issue, we delete the timer instance from ack_list and
active_list unconditionally in snd_timer_stop1().

Signed-off-by: Wang Wensheng &lt;wangwensheng4@huawei.com&gt;
Suggested-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20211103033517.80531-1-wangwensheng4@huawei.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: timer: Fix master timer notification</title>
<updated>2021-06-03T07:39:58Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2021-06-02T11:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c1fe96bded935369f8340c2ac2e9e189f697d5d'/>
<id>urn:sha1:9c1fe96bded935369f8340c2ac2e9e189f697d5d</id>
<content type='text'>
snd_timer_notify1() calls the notification to each slave for a master
event, but it passes a wrong event number.  It should be +10 offset,
corresponding to SNDRV_TIMER_EVENT_MXXX, but it's incorrectly with
+100 offset.  Casually this was spotted by UBSAN check via syzkaller.

Reported-by: syzbot+d102fa5b35335a7e544e@syzkaller.appspotmail.com
Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/000000000000e5560e05c3bd1d63@google.com
Link: https://lore.kernel.org/r/20210602113823.23777-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
