<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core/pcm.c, branch linux-5.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-12-13T08:14:33Z</updated>
<entry>
<title>ALSA: pcm: Fix potential Spectre v1 vulnerability</title>
<updated>2018-12-13T08:14:33Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2018-12-12T21:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94ffb030b6d31ec840bb811be455dd2e26a4f43e'/>
<id>urn:sha1:94ffb030b6d31ec840bb811be455dd2e26a4f43e</id>
<content type='text'>
stream is indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

sound/core/pcm.c:140 snd_pcm_control_ioctl() warn: potential spectre issue 'pcm-&gt;streams' [r] (local cap)

Fix this by sanitizing stream before using it to index pcm-&gt;streams

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&amp;m=152449131114778&amp;w=2

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Use snd_pcm_stop_xrun() for xrun injection</title>
<updated>2018-07-04T13:34:59Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-07-04T13:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e647f5a5c5d165c87750e8c0dcbe341b5a378ffd'/>
<id>urn:sha1:e647f5a5c5d165c87750e8c0dcbe341b5a378ffd</id>
<content type='text'>
Basically the xrun injection routine can simply call the standard
helper snd_pcm_stop_xrun(), but with one exception: it may be called
even when the stream is closed.

Make snd_pcm_stop_xrun() more robust and check the NULL runtime state,
and simplify xrun injection code by calling it.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: trace XRUN event at injection, too</title>
<updated>2018-07-04T13:34:57Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-07-04T12:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cd641ed31f576d08f7b784850ba93eef050f32f'/>
<id>urn:sha1:9cd641ed31f576d08f7b784850ba93eef050f32f</id>
<content type='text'>
The PCM xrun injection triggers directly snd_pcm_stop() without the
standard xrun handler, hence it's not recorded on the event buffer.
Ditto for snd_pcm_stop_xrun() call and SNDRV_PCM_IOCTL_XRUN ioctl.
They are inconvenient from the debugging POV.

Let's make them to trigger XRUN via the standard helper more
consistently.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>sound: Use octal not symbolic permissions</title>
<updated>2018-05-28T09:27:20Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2018-05-23T19:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a73cf46ce9d1b382ea14d74ce4bc9aa0c52337a'/>
<id>urn:sha1:6a73cf46ce9d1b382ea14d74ce4bc9aa0c52337a</id>
<content type='text'>
Convert the S_&lt;FOO&gt; symbolic permissions to their octal equivalents as
using octal and not symbolic permissions is preferred by many as more
readable.

see: https://lkml.org/lkml/2016/8/2/1945

Done with automated conversion via:
$ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace &lt;files...&gt;

Miscellanea:

o Wrapped one multi-line call to a single line

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Acked-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Fix UAF at PCM release via PCM timer access</title>
<updated>2018-04-03T06:36:40Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-04-02T20:41:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b'/>
<id>urn:sha1:a820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b</id>
<content type='text'>
The PCM runtime object is created and freed dynamically at PCM stream
open / close time.  This is tracked via substream-&gt;runtime, and it's
cleared at snd_pcm_detach_substream().

The runtime object assignment is protected by PCM open_mutex, so for
all PCM operations, it's safely handled.  However, each PCM substream
provides also an ALSA timer interface, and user-space can access to
this while closing a PCM substream.  This may eventually lead to a
UAF, as snd_pcm_timer_resolution() tries to access the runtime while
clearing it in other side.

Fortunately, it's the only concurrent access from the PCM timer, and
it merely reads runtime-&gt;timer_resolution field.  So, we can avoid the
race by reordering kfree() and wrapping the substream-&gt;runtime
clearance with the corresponding timer lock.

Reported-by: syzbot+8e62ff4e07aa2ce87826@syzkaller.appspotmail.com
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: prevent UAF in snd_pcm_info</title>
<updated>2017-12-05T22:28:08Z</updated>
<author>
<name>Robb Glasser</name>
</author>
<published>2017-12-05T17:16:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=362bca57f5d78220f8b5907b875961af9436e229'/>
<id>urn:sha1:362bca57f5d78220f8b5907b875961af9436e229</id>
<content type='text'>
When the device descriptor is closed, the `substream-&gt;runtime` pointer
is freed. But another thread may be in the ioctl handler, case
SNDRV_CTL_IOCTL_PCM_INFO. This case calls snd_pcm_info_user() which
calls snd_pcm_info() which accesses the now freed `substream-&gt;runtime`.

Note: this fixes CVE-2017-0861

Signed-off-by: Robb Glasser &lt;rglasser@google.com&gt;
Signed-off-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Forcibly stop at disconnect callback</title>
<updated>2017-10-18T06:05:46Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2017-10-11T09:42:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ca73de7ebc5dac358551633e0c69ab6b5007baa'/>
<id>urn:sha1:6ca73de7ebc5dac358551633e0c69ab6b5007baa</id>
<content type='text'>
So far we assumed that each driver implements the hotplug PCM handling
properly, e.g. dealing with the pending PCM stream at disconnect
callback.  But most codes don't care, and it eventually leaves the PCM
stream inconsistent state when an abrupt disconnection like sysfs
unbind happens.

This patch is simple but a big-hammer solution: invoke snd_pcm_stop()
at the common PCM disconnect callback always when the stream is
running.

Tested-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Don't call register and disconnect callbacks for internal PCM</title>
<updated>2017-10-18T06:05:34Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2017-10-17T09:40:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b645e4a40dd490b9426670fffe9bb9e2878c3fd'/>
<id>urn:sha1:8b645e4a40dd490b9426670fffe9bb9e2878c3fd</id>
<content type='text'>
The internal PCM (aka DPCM backend PCM) doesn't need any registration
procedure, thus currently we bail out immediately at dev_register
callback.  Similarly, its counterpart, dev_disconnect callback, is
superfluous for the internal PCM.  For simplifying and avoiding the
conflicting disconnect call for internal PCM objects, this patch drops
dev_register and dev_disconnect callbacks for the internal ops.

The only uncertain thing by this action is whether skipping the PCM
state change to SNDRV_PCM_STATE_DISCONNECT for the internal PCM is
mandatory.  Looking through the current implementations, this doesn't
look so, hence dropping the whole dev_disconnect would make more
sense.

Tested-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Correct broken procfs set up</title>
<updated>2017-08-24T22:05:16Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2017-08-24T20:11:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6b4c525d94e6fb28d5c4b9eb4016caa12f68841'/>
<id>urn:sha1:e6b4c525d94e6fb28d5c4b9eb4016caa12f68841</id>
<content type='text'>
The commit c8da9be4a75f ("ALSA: pcm: Adjust nine function calls
together with a variable assignment") contained a badly incorrect
conversion, a "status" PCM procfs creation was replaced with the next
one.  Luckily, this could be spotted easily by the kernel runtime
warning.

Fixes: c8da9be4a75f ("ALSA: pcm: Adjust nine function calls together...")
Reported-by: Fabio Estevam &lt;fabio.estevam@nxp.com&gt;
Tested-by: Fabio Estevam &lt;fabio.estevam@nxp.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Adjust nine function calls together with a variable assignment</title>
<updated>2017-08-23T08:36:18Z</updated>
<author>
<name>Markus Elfring</name>
</author>
<published>2017-08-23T07:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8da9be4a75f1f63024a16b976c5be47405c13dc'/>
<id>urn:sha1:c8da9be4a75f1f63024a16b976c5be47405c13dc</id>
<content type='text'>
The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
