<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/base, branch v3.10.97</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.97</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.97'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-22T21:37:51Z</updated>
<entry>
<title>regmap: debugfs: Don't bother actually printing when calculating max length</title>
<updated>2015-10-22T21:37:51Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-09-19T14:12:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0bdf7953e7c97de5100d5f4ecad7a5d0c760503c'/>
<id>urn:sha1:0bdf7953e7c97de5100d5f4ecad7a5d0c760503c</id>
<content type='text'>
commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream.

The in kernel snprintf() will conveniently return the actual length of
the printed string even if not given an output beffer at all so just do
that rather than relying on the user to pass in a suitable buffer,
ensuring that we don't need to worry if the buffer was truncated due to
the size of the buffer passed in.

Reported-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>regmap: debugfs: Ensure we don't underflow when printing access masks</title>
<updated>2015-10-22T21:37:51Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-09-19T14:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=789ef3db34ad5bbb3660dd7cf16810974021f9f1'/>
<id>urn:sha1:789ef3db34ad5bbb3660dd7cf16810974021f9f1</id>
<content type='text'>
commit b763ec17ac762470eec5be8ebcc43e4f8b2c2b82 upstream.

If a read is attempted which is smaller than the line length then we may
underflow the subtraction we're doing with the unsigned size_t type so
move some of the calculation to be additions on the right hand side
instead in order to avoid this.

Reported-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivercore: Fix unregistration path of platform devices</title>
<updated>2015-09-21T17:00:10Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2015-06-07T14:20:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6ae99d59c81abbf8943905f71dc796ae9560ac24'/>
<id>urn:sha1:6ae99d59c81abbf8943905f71dc796ae9560ac24</id>
<content type='text'>
commit 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 upstream.

The unregister path of platform_device is broken. On registration, it
will register all resources with either a parent already set, or
type==IORESOURCE_{IO,MEM}. However, on unregister it will release
everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
are also cases where resources don't get registered in the first place,
like with devices created by of_platform_populate()*.

Fix the unregister path to be symmetrical with the register path by
checking the parent pointer instead of the type field to decide which
resources to unregister. This is safe because the upshot of the
registration path algorithm is that registered resources have a parent
pointer, and non-registered resources do not.

* It can be argued that of_platform_populate() should be registering
  it's resources, and they argument has some merit. However, there are
  quite a few platforms that end up broken if we try to do that due to
  overlapping resources in the device tree. Until that is fixed, we need
  to solve the immediate problem.

Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Cc: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Ricardo Ribalda Delgado &lt;ricardo.ribalda@gmail.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Tested-by: Ricardo Ribalda Delgado &lt;ricardo.ribalda@gmail.com&gt;
Tested-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>devres: fix devres_get()</title>
<updated>2015-09-21T17:00:09Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2015-07-15T01:29:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=db4d79952cd299d81fdb1a87ef363d77df5976a5'/>
<id>urn:sha1:db4d79952cd299d81fdb1a87ef363d77df5976a5</id>
<content type='text'>
commit 64526370d11ce8868ca495723d595b61e8697fbf upstream.

Currently, devres_get() passes devres_free() the pointer to devres,
but devres_free() should be given with the pointer to resource data.

Fixes: 9ac7849e35f7 ("devres: device resource management")
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Fix firmware loader uevent buffer NULL pointer dereference</title>
<updated>2015-08-03T16:29:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-07-09T18:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=27dbfee9cffffa812e56f8a1a2f84f91d1d9ad63'/>
<id>urn:sha1:27dbfee9cffffa812e56f8a1a2f84f91d1d9ad63</id>
<content type='text'>
commit 6f957724b94cb19f5c1c97efd01dd4df8ced323c upstream.

The firmware class uevent function accessed the "fw_priv-&gt;buf" buffer
without the proper locking and testing for NULL.  This is an old bug
(looks like it goes back to 2012 and commit 1244691c73b2: "firmware
loader: introduce firmware_buf"), but for some reason it's triggering
only now in 4.2-rc1.

Shuah Khan is trying to bisect what it is that causes this to trigger
more easily, but in the meantime let's just fix the bug since others are
hitting it too (at least Ingo reports having seen it as well).

Reported-and-tested-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>regmap: Fix regmap_bulk_read in BE mode</title>
<updated>2015-08-03T16:29:41Z</updated>
<author>
<name>Arun Chandran</name>
<email>achandran@mvista.com</email>
</author>
<published>2015-06-15T10:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c9f4682139e837bb46eb0e19a0a728c573cc2ab4'/>
<id>urn:sha1:c9f4682139e837bb46eb0e19a0a728c573cc2ab4</id>
<content type='text'>
commit 15b8d2c41fe5839582029f65c5f7004db451cc2b upstream.

In big endian mode regmap_bulk_read gives incorrect data
for byte reads.

This is because memcpy of a single byte from an address
after full word read gives different results when
endianness differs. ie. we get little-end in LE and big-end in BE.

Signed-off-by: Arun Chandran &lt;achandran@mvista.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>driver core: Fix unbalanced device reference in drivers_probe</title>
<updated>2015-01-16T14:59:01Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2014-10-31T17:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bdf2a0db176e1de7c93fe7b7c5a74756b976fb33'/>
<id>urn:sha1:bdf2a0db176e1de7c93fe7b7c5a74756b976fb33</id>
<content type='text'>
commit bb34cb6bbd287b57e955bc5cfd42fcde6aaca279 upstream.

bus_find_device_by_name() acquires a device reference which is never
released.  This results in an object leak, which on older kernels
results in failure to release all resources of PCI devices.  libvirt
uses drivers_probe to re-attach devices to the host after assignment
and is therefore a common trigger for this leak.

Example:

# cd /sys/bus/pci/
# dmesg -C
# echo 1 &gt; devices/0000\:01\:00.0/sriov_numvfs
# echo 0 &gt; devices/0000\:01\:00.0/sriov_numvfs
# dmesg | grep 01:10
 pci 0000:01:10.0: [8086:10ca] type 00 class 0x020000
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_add_internal: parent: '0000:00:01.0', set: 'devices'
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_cleanup, parent           (null)
 kobject: '0000:01:10.0' (ffff8801d79cd0a8): calling ktype release
 kobject: '0000:01:10.0': free name

[kobject freed as expected]

# dmesg -C
# echo 1 &gt; devices/0000\:01\:00.0/sriov_numvfs
# echo 0000:01:10.0 &gt; drivers_probe
# echo 0 &gt; devices/0000\:01\:00.0/sriov_numvfs
# dmesg | grep 01:10
 pci 0000:01:10.0: [8086:10ca] type 00 class 0x020000
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_add_internal: parent: '0000:00:01.0', set: 'devices'
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
 kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'

[no free]

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sysfs: driver core: Fix glue dir race condition by gdp_mutex</title>
<updated>2014-11-14T16:48:01Z</updated>
<author>
<name>Yijing Wang</name>
<email>wangyijing@huawei.com</email>
</author>
<published>2014-11-07T04:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=afb16d3e8e031b25993df65dfdb92e503f596916'/>
<id>urn:sha1:afb16d3e8e031b25993df65dfdb92e503f596916</id>
<content type='text'>
commit e4a60d139060975eb956717e4f63ae348d4d8cc5 upstream.

There is a race condition when removing glue directory.
It can be reproduced in following test:

path 1: Add first child device
device_add()
    get_device_parent()
            /*find parent from glue_dirs.list*/
            list_for_each_entry(k, &amp;dev-&gt;class-&gt;p-&gt;glue_dirs.list, entry)
                    if (k-&gt;parent == parent_kobj) {
                            kobj = kobject_get(k);
                            break;
                    }
            ....
            class_dir_create_and_add()

path2: Remove last child device under glue dir
device_del()
    cleanup_device_parent()
            cleanup_glue_dir()
                    kobject_put(glue_dir);

If path2 has been called cleanup_glue_dir(), but not
call kobject_put(glue_dir), the glue dir is still
in parent's kset list. Meanwhile, path1 find the glue
dir from the glue_dirs.list. Path2 may release glue dir
before path1 call kobject_get(). So kernel will report
the warning and bug_on.

This is a "classic" problem we have of a kref in a list
that can be found while the last instance could be removed
at the same time.

This patch reuse gdp_mutex to fix this race condition.

The following calltrace is captured in kernel 3.4, but
the latest kernel still has this bug.

-----------------------------------------------------
&lt;4&gt;[ 3965.441471] WARNING: at ...include/linux/kref.h:41 kobject_get+0x33/0x40()
&lt;4&gt;[ 3965.441474] Hardware name: Romley
&lt;4&gt;[ 3965.441475] Modules linked in: isd_iop(O) isd_xda(O)...
...
&lt;4&gt;[ 3965.441605] Call Trace:
&lt;4&gt;[ 3965.441611]  [&lt;ffffffff8103717a&gt;] warn_slowpath_common+0x7a/0xb0
&lt;4&gt;[ 3965.441615]  [&lt;ffffffff810371c5&gt;] warn_slowpath_null+0x15/0x20
&lt;4&gt;[ 3965.441618]  [&lt;ffffffff81215963&gt;] kobject_get+0x33/0x40
&lt;4&gt;[ 3965.441624]  [&lt;ffffffff812d1e45&gt;] get_device_parent.isra.11+0x135/0x1f0
&lt;4&gt;[ 3965.441627]  [&lt;ffffffff812d22d4&gt;] device_add+0xd4/0x6d0
&lt;4&gt;[ 3965.441631]  [&lt;ffffffff812d0dbc&gt;] ? dev_set_name+0x3c/0x40
....
&lt;2&gt;[ 3965.441912] kernel BUG at ..../fs/sysfs/group.c:65!
&lt;4&gt;[ 3965.441915] invalid opcode: 0000 [#1] SMP
...
&lt;4&gt;[ 3965.686743]  [&lt;ffffffff811a677e&gt;] sysfs_create_group+0xe/0x10
&lt;4&gt;[ 3965.686748]  [&lt;ffffffff810cfb04&gt;] blk_trace_init_sysfs+0x14/0x20
&lt;4&gt;[ 3965.686753]  [&lt;ffffffff811fcabb&gt;] blk_register_queue+0x3b/0x120
&lt;4&gt;[ 3965.686756]  [&lt;ffffffff812030bc&gt;] add_disk+0x1cc/0x490
....
-------------------------------------------------------

Signed-off-by: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Weng Meiling &lt;wengmeiling.weng@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>firmware_class: make sure fw requests contain a name</title>
<updated>2014-10-30T16:35:10Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2014-09-18T18:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=71e82363fbf9b4c90bd70fc3b19fd4cea58b16a9'/>
<id>urn:sha1:71e82363fbf9b4c90bd70fc3b19fd4cea58b16a9</id>
<content type='text'>
commit 471b095dfe0d693a8d624cbc716d1ee4d74eb437 upstream.

An empty firmware request name will trigger warnings when building
device names. Make sure this is caught earlier and rejected.

The warning was visible via the test_firmware.ko module interface:

echo -ne "\x00" &gt; /sys/devices/virtual/misc/test_firmware/trigger_request

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>regmap: fix NULL pointer dereference in _regmap_write/read</title>
<updated>2014-10-30T16:35:10Z</updated>
<author>
<name>Pankaj Dubey</name>
<email>pankaj.dubey@samsung.com</email>
</author>
<published>2014-09-27T04:17:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a110e6d6ebac622c30c9d219b5b154d3d3167a20'/>
<id>urn:sha1:a110e6d6ebac622c30c9d219b5b154d3d3167a20</id>
<content type='text'>
commit 5336be8416a71b5568d2cf54a2f2066abe9f2a53 upstream.

If LOG_DEVICE is defined and map-&gt;dev is NULL it will lead to NULL
pointer dereference. This patch fixes this issue by adding check for
dev-&gt;NULL in all such places in regmap.c

Signed-off-by: Pankaj Dubey &lt;pankaj.dubey@samsung.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
