<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/sound/core/seq/oss, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-23T01:36:38Z</updated>
<entry>
<title>ALSA: seq: oss: Hardening for potential Spectre v1</title>
<updated>2018-05-23T01:36:38Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-04-24T05:31:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ad08cc48adcd4d8cd58a6d748a7b4b30b0d0d96'/>
<id>urn:sha1:9ad08cc48adcd4d8cd58a6d748a7b4b30b0d0d96</id>
<content type='text'>
[ Upstream commit 8d218dd8116695ecda7164f97631c069938aa22e ]

As Smatch recently suggested, a few places in OSS sequencer codes may
expand the array directly from the user-space value with speculation,
namely there are a significant amount of references to either
info-&gt;ch[] or dp-&gt;synths[] array:

  sound/core/seq/oss/seq_oss_event.c:315 note_on_event() warn: potential spectre issue 'info-&gt;ch' (local cap)
  sound/core/seq/oss/seq_oss_event.c:362 note_off_event() warn: potential spectre issue 'info-&gt;ch' (local cap)
  sound/core/seq/oss/seq_oss_synth.c:470 snd_seq_oss_synth_load_patch() warn: potential spectre issue 'dp-&gt;synths' (local cap)
  sound/core/seq/oss/seq_oss_event.c:293 note_on_event() warn: potential spectre issue 'dp-&gt;synths'
  sound/core/seq/oss/seq_oss_event.c:353 note_off_event() warn: potential spectre issue 'dp-&gt;synths'
  sound/core/seq/oss/seq_oss_synth.c:506 snd_seq_oss_synth_sysex() warn: potential spectre issue 'dp-&gt;synths'
  sound/core/seq/oss/seq_oss_synth.c:580 snd_seq_oss_synth_ioctl() warn: potential spectre issue 'dp-&gt;synths'

Although all these seem doing only the first load without further
reference, we may want to stay in a safer side, so hardening with
array_index_nospec() would still make sense.

We may put array_index_nospec() at each place, but here we take a
different approach:

- For dp-&gt;synths[], change the helpers to retrieve seq_oss_synthinfo
  pointer directly instead of the array expansion at each place

- For info-&gt;ch[], harden in a normal way, as there are only a couple
  of places

As a result, the existing helper, snd_seq_oss_synth_is_valid() is
replaced with snd_seq_oss_synth_info().  Also, we cover MIDI device
where a similar array expansion is done, too, although it wasn't
reported by Smatch.

BugLink: https://marc.info/?l=linux-kernel&amp;m=152411496503418&amp;w=2
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;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device</title>
<updated>2018-05-23T01:36:38Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2018-04-24T05:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc2fc4694a85effc0fc920997241f20c0775eb9e'/>
<id>urn:sha1:fc2fc4694a85effc0fc920997241f20c0775eb9e</id>
<content type='text'>
[ Upstream commit f5e94b4c6ebdabe0f602d796e0430180927521a0 ]

When get_synthdev() is called for a MIDI device, it returns the fixed
midi_synth_dev without the use refcounting.  OTOH, the caller is
supposed to unreference unconditionally after the usage, so this would
lead to unbalanced refcount.

This patch corrects the behavior and keep up the refcount balance also
for the MIDI synth device.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Fix OSS sysex delivery in OSS emulation</title>
<updated>2017-12-07T02:20:01Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2017-11-07T15:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b975b771930e4931a11f9d6fe7d9d54fd884c8ea'/>
<id>urn:sha1:b975b771930e4931a11f9d6fe7d9d54fd884c8ea</id>
<content type='text'>
[ Upstream commit 132d358b183ac6ad8b3fea32ad5e0663456d18d1 ]

The SYSEX event delivery in OSS sequencer emulation assumed that the
event is encoded in the variable-length data with the straight
buffering.  This was the normal behavior in the past, but during the
development, the chained buffers were introduced for carrying more
data, while the OSS code was left intact.  As a result, when a SYSEX
event with the chained buffer data is passed to OSS sequencer port,
it may end up with the wrong memory access, as if it were having a too
large buffer.

This patch addresses the bug, by applying the buffer data expansion by
the generic snd_seq_dump_var_event() helper function.

Reported-by: syzbot &lt;syzkaller@googlegroups.com&gt;
Reported-by: Mark Salyzyn &lt;salyzyn@android.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: oss: Don't drain at closing a client</title>
<updated>2016-03-09T18:15:23Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-03-01T17:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebe15c00057a4efad2bae1a90b04a20766cefc8c'/>
<id>urn:sha1:ebe15c00057a4efad2bae1a90b04a20766cefc8c</id>
<content type='text'>
[ Upstream commit 197b958c1e76a575d77038cc98b4bebc2134279f ]

The OSS sequencer client tries to drain the pending events at
releasing.  Unfortunately, as spotted by syzkaller fuzzer, this may
lead to an unkillable process state when the event has been queued at
the far future.  Since the process being released can't be signaled
any longer, it remains and waits for the echo-back event in that far
future.

Back to history, the draining feature was implemented at the time we
misinterpreted POSIX definition for blocking file operation.
Actually, such a behavior is superfluous at release, and we should
just release the device as is instead of keeping it up forever.

This patch just removes the draining call that may block the release
for too long time unexpectedly.

BugLink: http://lkml.kernel.org/r/CACT4Y+Y4kD-aBGj37rf-xBw9bH3GMU6P+MYg4W1e-s-paVD2pg@mail.gmail.com
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Degrade the error message for too many opens</title>
<updated>2016-02-15T20:45:21Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-01-25T10:24:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14a2303b85c63299dad236f0d2df9143d22b9242'/>
<id>urn:sha1:14a2303b85c63299dad236f0d2df9143d22b9242</id>
<content type='text'>
[ Upstream commit da10816e3d923565b470fec78a674baba794ed33 ]

ALSA OSS sequencer spews a kernel error message ("ALSA: seq_oss: too
many applications") when user-space tries to open more than the
limit.  This means that it can easily fill the log buffer.

Since it's merely a normal error, it's safe to suppress it via
pr_debug() instead.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()</title>
<updated>2016-02-15T20:45:21Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2016-01-25T10:01:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16116a3de550c2341933f4b0c54d7e52ceee4edf'/>
<id>urn:sha1:16116a3de550c2341933f4b0c54d7e52ceee4edf</id>
<content type='text'>
[ Upstream commit 599151336638d57b98d92338aa59c048e3a3e97d ]

ALSA sequencer OSS emulation code has a sanity check for currently
opened devices, but there is a thinko there, eventually it spews
warnings and skips the operation wrongly like:
  WARNING: CPU: 1 PID: 7573 at sound/core/seq/oss/seq_oss_synth.c:311

Fix this off-by-one error.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>ALSA: seq_oss: Drop superfluous error/debug messages after malloc failures</title>
<updated>2015-03-10T14:39:55Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2015-03-10T14:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d98a0673f761f9b7be51a293ca9142ec0c037ca'/>
<id>urn:sha1:8d98a0673f761f9b7be51a293ca9142ec0c037ca</id>
<content type='text'>
The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Drop snd_seq_autoload_lock() and _unlock()</title>
<updated>2015-02-12T13:42:31Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2015-02-12T13:20:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54a721abd7953a58e5479065c0cfdd8679d785c9'/>
<id>urn:sha1:54a721abd7953a58e5479065c0cfdd8679d785c9</id>
<content type='text'>
The autoload lock became already superfluous due to the recent rework
of autoload code.  Let's drop them now.  This allows us to simplify a
few codes nicely.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Define driver object in each driver</title>
<updated>2015-02-12T13:15:54Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2015-02-12T12:43:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=056622053b8ae02978678ac1321b5bd956e7c812'/>
<id>urn:sha1:056622053b8ae02978678ac1321b5bd956e7c812</id>
<content type='text'>
This patch moves the driver object initialization and allocation to
each driver's module init/exit code like other normal drivers.  The
snd_seq_driver struct is now published in seq_device.h, and each
driver is responsible to define it with proper driver attributes
(name, probe and remove) with snd_seq_driver specific attributes as id
and argsize fields.  The helper functions snd_seq_driver_register(),
snd_seq_driver_unregister() and module_snd_seq_driver() are used for
simplifying codes.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: seq: Deletion of unnecessary checks before the function call "snd_midi_event_free"</title>
<updated>2015-01-04T14:11:05Z</updated>
<author>
<name>Markus Elfring</name>
</author>
<published>2015-01-03T13:54:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57dca36ee25bcab20a71705175c00b6f114cdab4'/>
<id>urn:sha1:57dca36ee25bcab20a71705175c00b6f114cdab4</id>
<content type='text'>
The snd_midi_event_free() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

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