<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core/oss, 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: 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>
<entry>
<title>ALSA: pcm: Abort properly at pending signal in OSS read/write loops</title>
<updated>2018-03-03T15:50:56Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-01-08T12:58:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60c444b1c6af1cc3e0b34da57a5dd2d96d2d6da2'/>
<id>urn:sha1:60c444b1c6af1cc3e0b34da57a5dd2d96d2d6da2</id>
<content type='text'>
commit 29159a4ed7044c52e3e2cf1a9fb55cec4745c60b upstream.

The loops for read and write in PCM OSS emulation have no proper check
of pending signals, and they keep processing even after user tries to
break.  This results in a very long delay, often seen as RCU stall
when a huge unprocessed bytes remain queued.  The bug could be easily
triggered by syzkaller.

As a simple workaround, this patch adds the proper check of pending
signals and aborts the loop appropriately.

Reported-by: syzbot+993cb4cfcbbff3947c21@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: Add missing error checks in OSS emulation plugin builder</title>
<updated>2018-03-03T15:50:54Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-01-04T15:39:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de98c69ff495ba992f6ddbbf097d3311ae92db34'/>
<id>urn:sha1:de98c69ff495ba992f6ddbbf097d3311ae92db34</id>
<content type='text'>
commit 6708913750344a900f2e73bfe4a4d6dbbce4fe8d upstream.

In the OSS emulation plugin builder where the frame size is parsed in
the plugin chain, some places miss the possible errors returned from
the plugin src_ or dst_frames callback.

This patch papers over such places.

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 incorrect snd_BUG_ON() usages</title>
<updated>2018-03-03T15:50:53Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-01-01T08:50:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a36af0bf619c90274a11c518437c306fdaed4279'/>
<id>urn:sha1:a36af0bf619c90274a11c518437c306fdaed4279</id>
<content type='text'>
commit fe08f34d066f4404934a509b6806db1a4f700c86 upstream.

syzkaller triggered kernel warnings through PCM OSS emulation at
closing a stream:
  WARNING: CPU: 0 PID: 3502 at sound/core/pcm_lib.c:1635
  snd_pcm_hw_param_first+0x289/0x690 sound/core/pcm_lib.c:1635
  Call Trace:
  ....
   snd_pcm_hw_param_near.constprop.27+0x78d/0x9a0 sound/core/oss/pcm_oss.c:457
   snd_pcm_oss_change_params+0x17d3/0x3720 sound/core/oss/pcm_oss.c:969
   snd_pcm_oss_make_ready+0xaa/0x130 sound/core/oss/pcm_oss.c:1128
   snd_pcm_oss_sync+0x257/0x830 sound/core/oss/pcm_oss.c:1638
   snd_pcm_oss_release+0x20b/0x280 sound/core/oss/pcm_oss.c:2431
   __fput+0x327/0x7e0 fs/file_table.c:210
   ....

This happens while it tries to open and set up the aloop device
concurrently.  The warning above (invoked from snd_BUG_ON() macro) is
to detect the unexpected logical error where snd_pcm_hw_refine() call
shouldn't fail.  The theory is true for the case where the hw_params
config rules are static.  But for an aloop device, the hw_params rule
condition does vary dynamically depending on the connected target;
when another device is opened and changes the parameters, the device
connected in another side is also affected, and it caused the error
from snd_pcm_hw_refine().

That is, the simplest "solution" for this is to remove the incorrect
assumption of static rules, and treat such an error as a normal error
path.  As there are a couple of other places using snd_BUG_ON()
incorrectly, this patch removes these spurious snd_BUG_ON() calls.

Reported-by: syzbot+6f11c7e2a1b91d466432@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: Fix potential deadlock in OSS emulation</title>
<updated>2016-02-27T14:28:45Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-01-31T09:32:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bec0f5d5ed73c8058aee745000919fba65105a03'/>
<id>urn:sha1:bec0f5d5ed73c8058aee745000919fba65105a03</id>
<content type='text'>
commit b248371628aad599a48540962f6b85a21a8a0c3f upstream.

There are potential deadlocks in PCM OSS emulation code while
accessing read/write and mmap concurrently.  This comes from the
infamous mmap_sem usage in copy_from/to_user().  Namely,

   snd_pcm_oss_write() -&gt;
     &amp;runtime-&gt;oss.params_lock -&gt;
        copy_to_user() -&gt;
          &amp;mm-&gt;mmap_sem
  mmap() -&gt;
    &amp;mm-&gt;mmap_sem -&gt;
      snd_pcm_oss_mmap() -&gt;
        &amp;runtime-&gt;oss.params_lock

Since we can't avoid taking params_lock from mmap code path, use
trylock variant and aborts with -EAGAIN as a workaround of this AB/BA
deadlock.

BugLink: http://lkml.kernel.org/r/CACT4Y+bVrBKDG0G2_AcUgUQa+X91VKTeS4v+wN7BSHwHtqn3kQ@mail.gmail.com
Reported-by: Dmitry Vyukov &lt;dvyukov@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: Fix card refcount unbalance</title>
<updated>2012-11-16T16:47:11Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2012-11-08T13:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80b36c5e0e38ce18815c392a1fcbb16cd1480853'/>
<id>urn:sha1:80b36c5e0e38ce18815c392a1fcbb16cd1480853</id>
<content type='text'>
commit 8bb4d9ce08b0a92ca174e41d92c180328f86173f upstream.

There are uncovered cases whether the card refcount introduced by the
commit a0830dbd isn't properly increased or decreased:
- OSS PCM and mixer success paths
- When lookup function gets NULL

This patch fixes these places.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50251

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: Avoid endless sleep after disconnect</title>
<updated>2012-11-16T16:46:50Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2012-10-16T14:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38638f09259204fd9e6c6486867d8e2771ec5a4d'/>
<id>urn:sha1:38638f09259204fd9e6c6486867d8e2771ec5a4d</id>
<content type='text'>
commit 0914f7961babbf28aaa2f19b453951fb4841c03f upstream.

When disconnect callback is called, each component should wake up
sleepers and check card-&gt;shutdown flag for avoiding the endless sleep
blocking the proper resource release.

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: Add a reference counter to card instance</title>
<updated>2012-11-16T16:46:50Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2012-10-16T11:05:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3b4a36722e5e518e4bdd3a215d8a1c5adc18e911'/>
<id>urn:sha1:3b4a36722e5e518e4bdd3a215d8a1c5adc18e911</id>
<content type='text'>
commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85 upstream.

For more strict protection for wild disconnections, a refcount is
introduced to the card instance, and let it up/down when an object is
referred via snd_lookup_*() in the open ops.

The free-after-last-close check is also changed to check this refcount
instead of the empty list, too.

Reported-by: Matthieu CASTET &lt;matthieu.castet@parrot.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>sound: Add module.h to the previously silent sound users</title>
<updated>2011-10-31T23:31:21Z</updated>
<author>
<name>Paul Gortmaker</name>
</author>
<published>2011-07-15T16:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da155d5b40587815a4397e1a69382fe2366d940b'/>
<id>urn:sha1:da155d5b40587815a4397e1a69382fe2366d940b</id>
<content type='text'>
Lots of sound drivers were getting module.h via the implicit presence
of it in &lt;linux/device.h&gt; but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
</feed>
