<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core/oss, 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>2019-04-03T04:27:29Z</updated>
<entry>
<title>ALSA: pcm: Fix possible OOB access in PCM oss plugins</title>
<updated>2019-04-03T04:27:29Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2019-03-22T15:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94176d2a1d2b6f25286ee6a4b2e19655467b99ae'/>
<id>urn:sha1:94176d2a1d2b6f25286ee6a4b2e19655467b99ae</id>
<content type='text'>
commit ca0214ee2802dd47239a4e39fb21c5b00ef61b22 upstream.

The PCM OSS emulation converts and transfers the data on the fly via
"plugins".  The data is converted over the dynamically allocated
buffer for each plugin, and recently syzkaller caught OOB in this
flow.

Although the bisection by syzbot pointed out to the commit
65766ee0bf7f ("ALSA: oss: Use kvzalloc() for local buffer
allocations"), this is merely a commit to replace vmalloc() with
kvmalloc(), hence it can't be the cause.  The further debug action
revealed that this happens in the case where a slave PCM doesn't
support only the stereo channels while the OSS stream is set up for a
mono channel.  Below is a brief explanation:

At each OSS parameter change, the driver sets up the PCM hw_params
again in snd_pcm_oss_change_params_lock().  This is also the place
where plugins are created and local buffers are allocated.  The
problem is that the plugins are created before the final hw_params is
determined.  Namely, two snd_pcm_hw_param_near() calls for setting the
period size and periods may influence on the final result of channels,
rates, etc, too, while the current code has already created plugins
beforehand with the premature values.  So, the plugin believes that
channels=1, while the actual I/O is with channels=2, which makes the
driver reading/writing over the allocated buffer size.

The fix is simply to move the plugin allocation code after the final
hw_params call.

Reported-by: syzbot+d4503ae45b65c5bc1194@syzkaller.appspotmail.com
Cc: &lt;stable@vger.kernel.org&gt;
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: oss: Use kvzalloc() for local buffer allocations</title>
<updated>2018-11-09T13:12:04Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-11-09T10:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65766ee0bf7fe8b3be80e2e1c3ef54ad59b29476'/>
<id>urn:sha1:65766ee0bf7fe8b3be80e2e1c3ef54ad59b29476</id>
<content type='text'>
PCM OSS layer may allocate a few temporary buffers, one for the core
read/write and another for the conversions via plugins.  Currently
both are allocated via vmalloc().  But as the allocation size is
equivalent with the PCM period size, the required size might be quite
small, depending on the application.

This patch replaces these vmalloc() calls with kvzalloc() for covering
small period sizes better.  Also, we use "z"-alloc variant here for
addressing the possible uninitialized access reported by syzkaller.

Reported-by: syzbot+1cb36954e127c98dd037@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: signedness bug in snd_pcm_plug_alloc()</title>
<updated>2018-08-27T09:28:40Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2018-08-27T09:21:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f128fa41f310e1f39ebcea9621d2905549ecf52'/>
<id>urn:sha1:6f128fa41f310e1f39ebcea9621d2905549ecf52</id>
<content type='text'>
The "frames" variable is unsigned so the error handling doesn't work
properly.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Mark expected switch fall-through</title>
<updated>2018-08-01T16:13:04Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2018-08-01T15:58:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a6cd13d4faef48bdcb7ae9c1e98175332ced7cd'/>
<id>urn:sha1:5a6cd13d4faef48bdcb7ae9c1e98175332ced7cd</id>
<content type='text'>
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1357375 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Fix sparse warning wrt PCM format type</title>
<updated>2018-07-27T07:05:27Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-07-25T21:19:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8b6c0cfbdd7359db9bb4da38dd54217296f9264'/>
<id>urn:sha1:f8b6c0cfbdd7359db9bb4da38dd54217296f9264</id>
<content type='text'>
The PCM format type is with __bitwise, hence it needs the explicit
cast with __force.  It's ugly, but there is a reason for that cost...

This fixes the sparse warning:
  sound/core/oss/pcm_oss.c:1854:55: warning: incorrect type in argument 1 (different base types)

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Use standard lower_32_bits() and upper_32_bits()</title>
<updated>2018-07-26T06:32:31Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-07-25T21:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=191bb51e72c3b2b1ed1b2bd7ac30dd9f7ccea306'/>
<id>urn:sha1:191bb51e72c3b2b1ed1b2bd7ac30dd9f7ccea306</id>
<content type='text'>
Instead of open codes, use the standard macros for obtaining the lower
and upper 32bit values.

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 endless loop for XRUN recovery in OSS emulation</title>
<updated>2018-04-07T11:10:11Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-04-07T09:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e15dc99dbb9cf99f6432e8e3c0b3a8f7a3403a86'/>
<id>urn:sha1:e15dc99dbb9cf99f6432e8e3c0b3a8f7a3403a86</id>
<content type='text'>
The commit 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS
ioctls and read/write") split the PCM preparation code to a locked
version, and it added a sanity check of runtime-&gt;oss.prepare flag
along with the change.  This leaded to an endless loop when the stream
gets XRUN: namely, snd_pcm_oss_write3() and co call
snd_pcm_oss_prepare() without setting runtime-&gt;oss.prepare flag and
the loop continues until the PCM state reaches to another one.

As the function is supposed to execute the preparation
unconditionally, drop the invalid state check there.

The bug was triggered by syzkaller.

Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write")
Reported-by: syzbot+150189c103427d31a053@syzkaller.appspotmail.com
Reported-by: syzbot+7e3f31a52646f939c052@syzkaller.appspotmail.com
Reported-by: syzbot+4f2016cf5185da7759dc@syzkaller.appspotmail.com
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-next' into for-linus</title>
<updated>2018-04-02T17:50:59Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-04-02T17:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc334cb61b9ee6e85b9bb01519989a3ae8fe03f6'/>
<id>urn:sha1:bc334cb61b9ee6e85b9bb01519989a3ae8fe03f6</id>
<content type='text'>
Preparation for 4.17 merge.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Fix mutex unbalance in OSS emulation ioctls</title>
<updated>2018-03-27T14:20:02Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-03-27T12:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f6d297df4dd47ef949540e4a201230d0c5308325'/>
<id>urn:sha1:f6d297df4dd47ef949540e4a201230d0c5308325</id>
<content type='text'>
The previous fix 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS
ioctls changing busy streams") introduced some mutex unbalance; the
check of runtime-&gt;oss.rw_ref was inserted in a wrong place after the
mutex lock.

This patch fixes the inconsistency by rewriting with the helper
functions to lock/unlock parameters with the stream check.

Fixes: 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams")
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
