<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/spi/spidev.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-22T07:10:01Z</updated>
<entry>
<title>spi: spidev: fix a potential use-after-free in spidev_release()</title>
<updated>2020-07-22T07:10:01Z</updated>
<author>
<name>Zhenzhong Duan</name>
</author>
<published>2020-06-18T03:21:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=35d6f9af1654a2ea428541ec61a6092bbf2a10f1'/>
<id>urn:sha1:35d6f9af1654a2ea428541ec61a6092bbf2a10f1</id>
<content type='text'>
[ Upstream commit 06096cc6c5a84ced929634b0d79376b94c65a4bd ]

If an spi device is unbounded from the driver before the release
process, there will be an NULL pointer reference when it's
referenced in spi_slave_abort().

Fix it by checking it's already freed before reference.

Signed-off-by: Zhenzhong Duan &lt;zhenzhong.duan@gmail.com&gt;
Link: https://lore.kernel.org/r/20200618032125.4650-2-zhenzhong.duan@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev: fix a race between spidev_release and spidev_remove</title>
<updated>2020-07-22T07:10:01Z</updated>
<author>
<name>Zhenzhong Duan</name>
</author>
<published>2020-06-18T03:21:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8c4753285ae9740a48c9d81027395ef2f48b346'/>
<id>urn:sha1:d8c4753285ae9740a48c9d81027395ef2f48b346</id>
<content type='text'>
[ Upstream commit abd42781c3d2155868821f1b947ae45bbc33330d ]

Imagine below scene, spidev is referenced after it's freed.

spidev_release()                spidev_remove()
...
                                spin_lock_irq(&amp;spidev-&gt;spi_lock);
                                    spidev-&gt;spi = NULL;
                                spin_unlock_irq(&amp;spidev-&gt;spi_lock);
mutex_lock(&amp;device_list_lock);
dofree = (spidev-&gt;spi == NULL);
if (dofree)
    kfree(spidev);
mutex_unlock(&amp;device_list_lock);
                                mutex_lock(&amp;device_list_lock);
                                list_del(&amp;spidev-&gt;device_entry);
                                device_destroy(spidev_class, spidev-&gt;devt);
                                clear_bit(MINOR(spidev-&gt;devt), minors);
                                if (spidev-&gt;users == 0)
                                    kfree(spidev);
                                mutex_unlock(&amp;device_list_lock);

Fix it by resetting spidev-&gt;spi in device_list_lock's protection.

Signed-off-by: Zhenzhong Duan &lt;zhenzhong.duan@gmail.com&gt;
Link: https://lore.kernel.org/r/20200618032125.4650-1-zhenzhong.duan@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: Add call to spi_slave_abort() function when spidev driver is released</title>
<updated>2020-01-04T12:34:03Z</updated>
<author>
<name>Lukasz Majewski</name>
</author>
<published>2019-09-25T09:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12b7e214561833bed54e2443bbb4cb6d7c83577f'/>
<id>urn:sha1:12b7e214561833bed54e2443bbb4cb6d7c83577f</id>
<content type='text'>
[ Upstream commit 9f918a728cf86b2757b6a7025e1f46824bfe3155 ]

This change is necessary for spidev devices (e.g. /dev/spidev3.0) working
in the slave mode (like NXP's dspi driver for Vybrid SoC).

When SPI HW works in this mode - the master is responsible for providing
CS and CLK signals. However, when some fault happens - like for example
distortion on SPI lines - the SPI Linux driver needs a chance to recover
from this abnormal situation and prepare itself for next (correct)
transmission.

This change doesn't pose any threat on drivers working in master mode as
spi_slave_abort() function checks if SPI slave mode is supported.

Signed-off-by: Lukasz Majewski &lt;lukma@denx.de&gt;
Link: https://lore.kernel.org/r/20190924110547.14770-2-lukma@denx.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Link: https://lore.kernel.org/r/20190925091143.15468-2-lukma@denx.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev: Fix OF tree warning logic</title>
<updated>2019-11-25T14:54:50Z</updated>
<author>
<name>Trent Piepho</name>
</author>
<published>2018-09-20T19:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=91a9d24e3f04b78e844a302177b753cd37ac3851'/>
<id>urn:sha1:91a9d24e3f04b78e844a302177b753cd37ac3851</id>
<content type='text'>
[ Upstream commit 605b3bec73cbd74b4ac937b580cd0b47d1300484 ]

spidev will make a big fuss if a device tree node binds a device by
using "spidev" as the node's compatible property.

However, the logic for this isn't looking for "spidev" in the
compatible, but rather checking that the device is NOT compatible with
spidev's list of devices.

This causes a false positive if a device not named "rohm,dh2228fv", etc.
binds to spidev, even if a means other than putting "spidev" in the
device tree was used.  E.g., the sysfs driver_override attribute.

Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
Reviewed-by: Jan KundrÃ¡t &lt;jan.kundrat@cesnet.cz&gt;
Tested-by: Jan KundrÃ¡t &lt;jan.kundrat@cesnet.cz&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev: Hold spi_lock over all defererences of spi in release()</title>
<updated>2015-12-16T12:09:35Z</updated>
<author>
<name>Mark Brown</name>
</author>
<published>2015-11-16T13:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56ea1075e7f07724cf9b91039aa0968a0c70112f'/>
<id>urn:sha1:56ea1075e7f07724cf9b91039aa0968a0c70112f</id>
<content type='text'>
We use the spi_lock spinlock to protect against races between the device
being removed and file operations on the spidev.  This means that in the
removal path all references to the device need to be done under lock as
in removal we dropping references to the device.

Reported-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next</title>
<updated>2015-11-04T11:02:12Z</updated>
<author>
<name>Mark Brown</name>
</author>
<published>2015-11-04T11:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c84518523f888994c618585021c76fa499d465e'/>
<id>urn:sha1:4c84518523f888994c618585021c76fa499d465e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spi: Drop owner assignment from spi_drivers</title>
<updated>2015-10-28T01:30:17Z</updated>
<author>
<name>Andrew F. Davis</name>
</author>
<published>2015-10-23T13:59:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3821a065f5672c430a088ae68b4da2a2d2b34106'/>
<id>urn:sha1:3821a065f5672c430a088ae68b4da2a2d2b34106</id>
<content type='text'>
An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis &lt;afd@ti.com&gt;
Acked-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'spi/fix/spidev' and 'spi/fix/xtfpga' into spi-linus</title>
<updated>2015-09-22T16:48:41Z</updated>
<author>
<name>Mark Brown</name>
</author>
<published>2015-09-22T16:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=711e020cae9cd105d81a783686cb8c8059c08b2c'/>
<id>urn:sha1:711e020cae9cd105d81a783686cb8c8059c08b2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spi: spidev: fix possible NULL dereference</title>
<updated>2015-09-11T12:26:38Z</updated>
<author>
<name>Sudip Mukherjee</name>
</author>
<published>2015-09-10T11:18:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd85ebf681ef0ee1fc985c353dd45e8b53b5dc1e'/>
<id>urn:sha1:dd85ebf681ef0ee1fc985c353dd45e8b53b5dc1e</id>
<content type='text'>
During the last close we are freeing spidev if spidev-&gt;spi is NULL, but
just before checking if spidev-&gt;spi is NULL we are dereferencing it.
Lets add a check there to avoid the NULL dereference.

Fixes: 9169051617df ("spi: spidev: Don't mangle max_speed_hz in underlying spi device")
Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Reviewed-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Tested-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'spi/topic/s3c64xx', 'spi/topic/sg', 'spi/topic/sh-msiof', 'spi/topic/spidev' and 'spi/topic/stats' into spi-next</title>
<updated>2015-08-31T13:45:41Z</updated>
<author>
<name>Mark Brown</name>
</author>
<published>2015-08-31T13:45:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c92ec7c7ae99a371bbc69f0258888a0328ba4838'/>
<id>urn:sha1:c92ec7c7ae99a371bbc69f0258888a0328ba4838</id>
<content type='text'>
</content>
</entry>
</feed>
