<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/sound/core/init.c, branch v3.14.24</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.14.24</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.14.24'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2014-06-26T19:15:43+00:00</updated>
<entry>
<title>ALSA: control: Protect user controls against concurrent access</title>
<updated>2014-06-26T19:15:43+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2014-06-18T11:32:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d8e2983ef545510f39b3b67d639d807672ee0893'/>
<id>urn:sha1:d8e2983ef545510f39b3b67d639d807672ee0893</id>
<content type='text'>
commit 07f4d9d74a04aa7c72c5dae0ef97565f28f17b92 upstream.

The user-control put and get handlers as well as the tlv do not protect against
concurrent access from multiple threads. Since the state of the control is not
updated atomically it is possible that either two write operations or a write
and a read operation race against each other. Both can lead to arbitrary memory
disclosure. This patch introduces a new lock that protects user-controls from
concurrent access. Since applications typically access controls sequentially
than in parallel a single lock per card should be fine.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Acked-by: Jaroslav Kysela &lt;perex@perex.cz&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: Refactor slot assignment code</title>
<updated>2014-01-23T10:45:24+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2014-01-23T10:02:15+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=deb6596f163b7340ff8f5a7c23e25317e165c669'/>
<id>urn:sha1:deb6596f163b7340ff8f5a7c23e25317e165c669</id>
<content type='text'>
There are two loops that are almost identical but only with different
checks.  Refactor them with a simple helper, and give a bit more
comments what's doing there.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: bits vs bytes bug in snd_card_create()</title>
<updated>2014-01-23T09:50:36+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-01-23T08:21:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4c3773eda49c872a3034382f8ec3080002e715bf'/>
<id>urn:sha1:4c3773eda49c872a3034382f8ec3080002e715bf</id>
<content type='text'>
The test here is intended intended to prevent shift wrapping bugs when
we do "1U &lt;&lt; idx2".  We should consider the number of bits in a u32
instead of the number of bytes.

[fix another chunk similarly by tiwai]

Fixes: 7bb2491b35a2 ('ALSA: Add kconfig to specify the max card numbers')
Signed-off-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>
<entry>
<title>ALSA: Limit the fallback card id string size</title>
<updated>2013-10-29T14:20:06+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-10-29T14:20:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=97f44f56ca94709f45bc348f5d2c88696eae5f9b'/>
<id>urn:sha1:97f44f56ca94709f45bc348f5d2c88696eae5f9b</id>
<content type='text'>
When no proper id string is given, the driver tries to fall back to
copy the proc_root name string via strcpy(), but this might overflow
the fixed string size.  Let's use strlcpy().

Spotted by coverity CID 139008.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Optimize module name check</title>
<updated>2013-10-29T10:37:42+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-10-28T11:54:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=60f6fef877d52525b8887d27cfacf74a279e3e12'/>
<id>urn:sha1:60f6fef877d52525b8887d27cfacf74a279e3e12</id>
<content type='text'>
module-&gt;name is a fixed array, so we can check the empty contents
straightforwardly in module_slot_match().

Spotted by coverity CID 1056786.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Add kconfig to specify the max card numbers</title>
<updated>2013-05-24T14:41:46+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-05-15T06:46:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7bb2491b35a254fe6fd592c32a142a2f2f31fe6e'/>
<id>urn:sha1:7bb2491b35a254fe6fd592c32a142a2f2f31fe6e</id>
<content type='text'>
Currently ALSA supports up to 32 card instances when the dynamic minor
is used.  While 32 cards are usually big enough for normal use cases,
there are sometimes weird requirements with more card support.

Actually, this limitation, 32, comes from the index option, where you
can pass the bit mask to assign the card.  Other than that, we can
actually give more cards up to the minor number limits (currently 256,
which can be extended more, too).

This patch adds a new Kconfig to specify the max card numbers, and
changes a few places to accept more than 32 cards.

The only incompatibility with high card numbers would be the handling
of index option.  The index option can be still used to pass the
bitmask for card assignments, but this works only up to 32 slots.
More than 32, no bitmask style option is available but only a single
slot can be specified via index option.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Fix the default suffix string with high card number</title>
<updated>2013-05-24T14:30:39+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-05-24T14:30:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8edbb198a62e2c3d0bea06ce50a4d45a009849b6'/>
<id>urn:sha1:8edbb198a62e2c3d0bea06ce50a4d45a009849b6</id>
<content type='text'>
ALSA core tries to add a suffix as "_1" automatically when the given
id string conflicts.  The current code assumes implicitly that the max
card number is 16 so that the single hex "_X" suffix can be put.
However, with the dynamic device management, the card can be at most
32, so it can put even a non-hex character there.  Also, when the max
card number is increased in future, this would result in worse.

This patch rewrites the code to add the suffix string in a simpler
(thus cleaner) way.  It can support up to three digits, so it should
suffice for most requirements.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: add/change some comments describing function return values</title>
<updated>2013-03-12T07:32:53+00:00</updated>
<author>
<name>Yacine Belkadi</name>
<email>yacine.belkadi.1@gmail.com</email>
</author>
<published>2013-03-11T21:05:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=eb7c06e8e9c93b495e355421cffd3c43c266d7d2'/>
<id>urn:sha1:eb7c06e8e9c93b495e355421cffd3c43c266d7d2</id>
<content type='text'>
script/kernel-doc reports the following type of warnings (when run in verbose
mode):

Warning(sound/core/init.c:152): No description found for return value of
'snd_card_create'

To fix that:
- add missing descriptions of function return values
- use "Return:" sections to describe those return values

Along the way:
- complete some descriptions
- fix some typos

Signed-off-by: Yacine Belkadi &lt;yacine.belkadi.1@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: Add a reference counter to card instance</title>
<updated>2012-10-30T10:07:10+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-10-16T11:05:59+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85'/>
<id>urn:sha1:a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85</id>
<content type='text'>
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;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux</title>
<updated>2012-03-24T17:41:37+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-24T17:41:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=250f6715a4112d6686670c5a62ceb9305da94616'/>
<id>urn:sha1:250f6715a4112d6686670c5a62ceb9305da94616</id>
<content type='text'>
Pull &lt;linux/device.h&gt; avoidance patches from Paul Gortmaker:
 "Nearly every subsystem has some kind of header with a proto like:

	void foo(struct device *dev);

  and yet there is no reason for most of these guys to care about the
  sub fields within the device struct.  This allows us to significantly
  reduce the scope of headers including headers.  For this instance, a
  reduction of about 40% is achieved by replacing the include with the
  simple fact that the device is some kind of a struct.

  Unlike the much larger module.h cleanup, this one is simply two
  commits.  One to fix the implicit &lt;linux/device.h&gt; users, and then one
  to delete the device.h includes from the linux/include/ dir wherever
  possible."

* tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  device.h: audit and cleanup users in main include dir
  device.h: cleanup users outside of linux/include (C files)
</content>
</entry>
</feed>
