<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core, branch linux-3.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-31T23:30:25Z</updated>
<entry>
<title>ALSA: pcm: potential uninitialized return values</title>
<updated>2018-05-31T23:30:25Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2018-03-27T13:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9f249188a2927b7809ed790e4b568ea82039d919'/>
<id>urn:sha1:9f249188a2927b7809ed790e4b568ea82039d919</id>
<content type='text'>
commit 5607dddbfca774fb38bffadcb077fe03aa4ac5c6 upstream.

Smatch complains that "tmp" can be uninitialized if we do a zero size
write.

Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent()</title>
<updated>2018-05-31T23:30:25Z</updated>
<author>
<name>Stefan Roese</name>
</author>
<published>2018-03-26T14:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1731866a8cdbf8b8c49348083c565ba0f2b6abff'/>
<id>urn:sha1:1731866a8cdbf8b8c49348083c565ba0f2b6abff</id>
<content type='text'>
commit 9066ae7ff5d89c0b5daa271e2d573540097a94fa upstream.

When trying to use the driver (e.g. aplay *.wav), the 4MiB DMA buffer
will get mmapp'ed in 16KiB chunks. But this fails with the 2nd 16KiB
area, as the page offset is outside of the VMA range (size), which is
currently used as size parameter in snd_pcm_lib_default_mmap(). By
using the DMA buffer size (dma_bytes) instead, the complete DMA buffer
can be mmapp'ed and the issue is fixed.

This issue was detected on an ARM platform (TI AM57xx) using the RME
HDSP MADI PCIe soundcard.

Fixes: 657b1989dacf ("ALSA: pcm - Use dma_mmap_coherent() if available")
Signed-off-by: Stefan Roese &lt;sr@denx.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Clear client entry before deleting else at closing</title>
<updated>2018-05-31T23:30:21Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-03-09T21:23:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1282010aae8a0945fcf70b2a3c8ffbd921faed04'/>
<id>urn:sha1:1282010aae8a0945fcf70b2a3c8ffbd921faed04</id>
<content type='text'>
commit a2ff19f7b70118ced291a28d5313469914de451b upstream.

When releasing a client, we need to clear the clienttab[] entry at
first, then call snd_seq_queue_client_leave().  Otherwise, the
in-flight cell in the queue might be picked up by the timer interrupt
via snd_seq_check_queue() before calling snd_seq_queue_client_leave(),
and it's delivered to another queue while the client is clearing
queues.  This may eventually result in an uncleared cell remaining in
a queue, and the later snd_seq_pool_delete() may need to wait for a
long time until the event gets really processed.

By moving the clienttab[] clearance at the beginning of release, any
event delivery of a cell belonging to this client will fail at a later
point, since snd_seq_client_ptr() returns NULL.  Thus the cell that
was picked up by the timer interrupt will be returned immediately
without further delivery, and the long stall of snd_seq_delete_pool()
can be avoided, too.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Fix possible UAF in snd_seq_check_queue()</title>
<updated>2018-05-31T23:30:21Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-03-09T20:58:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=deeaca310dc1d79b70384810c47b64b550f6bef7'/>
<id>urn:sha1:deeaca310dc1d79b70384810c47b64b550f6bef7</id>
<content type='text'>
commit d0f833065221cbfcbadf19fd4102bcfa9330006a upstream.

Although we've covered the races between concurrent write() and
ioctl() in the previous patch series, there is still a possible UAF in
the following scenario:

A: user client closed		B: timer irq
  -&gt; snd_seq_release()		  -&gt; snd_seq_timer_interrupt()
    -&gt; snd_seq_free_client()	    -&gt; snd_seq_check_queue()
				      -&gt; cell = snd_seq_prioq_cell_peek()
      -&gt; snd_seq_prioq_leave()
         .... removing all cells
      -&gt; snd_seq_pool_done()
         .... vfree()
				      -&gt; snd_seq_compare_tick_time(cell)
				         ... Oops

So the problem is that a cell is peeked and accessed without any
protection until it's retrieved from the queue again via
snd_seq_prioq_cell_out().

This patch tries to address it, also cleans up the code by a slight
refactoring.  snd_seq_prioq_cell_out() now receives an extra pointer
argument.  When it's non-NULL, the function checks the event timestamp
with the given pointer.  The caller needs to pass the right reference
either to snd_seq_tick or snd_seq_realtime depending on the event
timestamp type.

A good news is that the above change allows us to remove the
snd_seq_prioq_cell_peek(), too, thus the patch actually reduces the
code size.

Reviewed-by: Nicolai Stange &lt;nstange@suse.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
[bwh: Backported to 3.2: Deleted function had different log message]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: More protection for concurrent write and ioctl races</title>
<updated>2018-05-31T23:30:02Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-03-05T21:06:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a63d970eecf933973eae20b069f3755a7824b24'/>
<id>urn:sha1:1a63d970eecf933973eae20b069f3755a7824b24</id>
<content type='text'>
commit 7bd80091567789f1c0cb70eb4737aac8bcd2b6b9 upstream.

This patch is an attempt for further hardening against races between
the concurrent write and ioctls.  The previous fix d15d662e89fc
("ALSA: seq: Fix racy pool initializations") covered the race of the
pool initialization at writer and the pool resize ioctl by the
client-&gt;ioctl_mutex (CVE-2018-1000004).  However, basically this mutex
should be applied more widely to the whole write operation for
avoiding the unexpected pool operations by another thread.

The only change outside snd_seq_write() is the additional mutex
argument to helper functions, so that we can unlock / relock the given
mutex temporarily during schedule() call for blocking write.

Fixes: d15d662e89fc ("ALSA: seq: Fix racy pool initializations")
Reported-by: 范龙飞 &lt;long7573@126.com&gt;
Reported-by: Nicolai Stange &lt;nstange@suse.de&gt;
Reviewed-and-tested-by: Nicolai Stange &lt;nstange@suse.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: correctly detect input buffer overflow</title>
<updated>2018-05-31T23:30:02Z</updated>
<author>
<name>Adam Goode</name>
</author>
<published>2014-06-04T05:02:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d89ffc7140e70fd8429f7147c552bdf22750a717'/>
<id>urn:sha1:d89ffc7140e70fd8429f7147c552bdf22750a717</id>
<content type='text'>
commit 21fd3e956ee8a307a06bc6e095f5767a00eb2a7e upstream.

snd_seq_event_dup returns -ENOMEM in some buffer-full conditions,
but usually returns -EAGAIN. Make -EAGAIN trigger the overflow
condition in snd_seq_fifo_event_in so that the fifo is cleared
and -ENOSPC is returned to userspace as stated in the alsa-lib docs.

Signed-off-by: Adam Goode &lt;agoode@google.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Don't allow resizing pool in use</title>
<updated>2018-05-31T23:30:02Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-03-05T21:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c96a7302975ce043f565c9ce2359794e1397488c'/>
<id>urn:sha1:c96a7302975ce043f565c9ce2359794e1397488c</id>
<content type='text'>
commit d85739367c6d56e475c281945c68fdb05ca74b4c upstream.

This is a fix for a (sort of) fallout in the recent commit
d15d662e89fc ("ALSA: seq: Fix racy pool initializations") for
CVE-2018-1000004.
As the pool resize deletes the existing cells, it may lead to a race
when another thread is writing concurrently, eventually resulting a
UAF.

A simple workaround is not to allow the pool resizing when the pool is
in use.  It's an invalid behavior in anyway.

Fixes: d15d662e89fc ("ALSA: seq: Fix racy pool initializations")
Reported-by: 范龙飞 &lt;long7573@126.com&gt;
Reported-by: Nicolai Stange &lt;nstange@suse.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Fix racy pool initializations</title>
<updated>2018-05-31T23:30:02Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-02-12T14:20:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5c3d49b3d5889f334d519d7a4535a3bd8632d47'/>
<id>urn:sha1:b5c3d49b3d5889f334d519d7a4535a3bd8632d47</id>
<content type='text'>
commit d15d662e89fc667b90cd294b0eb45694e33144da upstream.

ALSA sequencer core initializes the event pool on demand by invoking
snd_seq_pool_init() when the first write happens and the pool is
empty.  Meanwhile user can reset the pool size manually via ioctl
concurrently, and this may lead to UAF or out-of-bound accesses since
the function tries to vmalloc / vfree the buffer.

A simple fix is to just wrap the snd_seq_pool_init() call with the
recently introduced client-&gt;ioctl_mutex; as the calls for
snd_seq_pool_init() from other side are always protected with this
mutex, we can avoid the race.

Reported-by: 范龙飞 &lt;long7573@126.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Remove yet superfluous WARN_ON()</title>
<updated>2018-03-03T15:50:58Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-01-10T22:48:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccaa16ab073a8e0b94ce1d32d9da1199adf712df'/>
<id>urn:sha1:ccaa16ab073a8e0b94ce1d32d9da1199adf712df</id>
<content type='text'>
commit 23b19b7b50fe1867da8d431eea9cd3e4b6328c2c upstream.

muldiv32() contains a snd_BUG_ON() (which is morphed as WARN_ON() with
debug option) for checking the case of 0 / 0.  This would be helpful
if this happens only as a logical error; however, since the hw refine
is performed with any data set provided by user, the inconsistent
values that can trigger such a condition might be passed easily.
Actually, syzbot caught this by passing some zero'ed old hw_params
ioctl.

So, having snd_BUG_ON() there is simply superfluous and rather
harmful to give unnecessary confusions.  Let's get rid of it.

Reported-by: syzbot+7e6ee55011deeebce15d@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Allow aborting mutex lock at OSS read/write loops</title>
<updated>2018-03-03T15:50:57Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-01-08T13:03:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84f7438d82337ab4cbb9f04d031a0005514f78b3'/>
<id>urn:sha1:84f7438d82337ab4cbb9f04d031a0005514f78b3</id>
<content type='text'>
commit 900498a34a3ac9c611e9b425094c8106bdd7dc1c upstream.

PCM OSS read/write loops keep taking the mutex lock for the whole
read/write, and this might take very long when the exceptionally high
amount of data is given.  Also, since it invokes with mutex_lock(),
the concurrent read/write becomes unbreakable.

This patch tries to address these issues by replacing mutex_lock()
with mutex_lock_interruptible(), and also splits / re-takes the lock
at each read/write period chunk, so that it can switch the context
more finely if requested.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
