<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/i2c/i2c-dev.c, branch v4.14</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-01-12T19:06:10Z</updated>
<entry>
<title>i2c: fix kernel memory disclosure in dev interface</title>
<updated>2017-01-12T19:06:10Z</updated>
<author>
<name>Vlad Tsyrklevich</name>
<email>vlad@tsyrklevich.net</email>
</author>
<published>2017-01-09T15:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=30f939feaeee23e21391cfc7b484f012eb189c3c'/>
<id>urn:sha1:30f939feaeee23e21391cfc7b484f012eb189c3c</id>
<content type='text'>
i2c_smbus_xfer() does not always fill an entire block, allowing
kernel stack memory disclosure through the temp variable. Clear
it before it's read to.

Signed-off-by: Vlad Tsyrklevich &lt;vlad@tsyrklevich.net&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>i2c-dev: don't get i2c adapter via i2c_dev</title>
<updated>2016-07-08T01:29:31Z</updated>
<author>
<name>viresh kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2016-07-06T02:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5136ed4fcb05cd4981cc6034a11e66370ed84789'/>
<id>urn:sha1:5136ed4fcb05cd4981cc6034a11e66370ed84789</id>
<content type='text'>
There is no code protecting i2c_dev to be freed after it is returned
from i2c_dev_get_by_minor() and using it to access the value which we
already have (minor) isn't safe really.

Avoid using it and get the adapter directly from 'minor'.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Tested-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: use after free in detach</title>
<updated>2016-05-28T15:37:42Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-05-28T05:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf'/>
<id>urn:sha1:e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf</id>
<content type='text'>
The call to put_i2c_dev() frees "i2c_dev" so there is a use after
free when we call cdev_del(&amp;i2c_dev-&gt;cdev).

Fixes: d6760b14d4a1 ('i2c: dev: switch from register_chrdev to cdev API')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: don't start function name with 'return'</title>
<updated>2016-05-27T11:13:01Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-05-27T11:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=72a71f869c95dc11b73f09fe18c593d4a0618c3f'/>
<id>urn:sha1:72a71f869c95dc11b73f09fe18c593d4a0618c3f</id>
<content type='text'>
I stumbled multiple times over 'return_i2c_dev', especially before the
actual 'return res'. It makes the code hard to read, so reanme the
function to 'put_i2c_dev' which also better matches 'get_free_i2c_dev'.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: switch from register_chrdev to cdev API</title>
<updated>2016-05-26T19:18:57Z</updated>
<author>
<name>Erico Nunes</name>
<email>erico.nunes@datacom.ind.br</email>
</author>
<published>2016-05-03T18:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6760b14d4a1243f918d983bba1e35c5a5cd5a6d'/>
<id>urn:sha1:d6760b14d4a1243f918d983bba1e35c5a5cd5a6d</id>
<content type='text'>
i2c-dev had never moved away from the older register_chrdev interface to
implement its char device registration. The register_chrdev API has the
limitation of enabling only up to 256 i2c-dev busses to exist.

Large platforms with lots of i2c devices (i.e. pluggable transceivers)
with dedicated busses may have to exceed that limit.
In particular, there are also platforms making use of the i2c bus
multiplexing API, which instantiates a virtual bus for each possible
multiplexed selection.

This patch removes the register_chrdev usage and replaces it with the
less old cdev API, which takes away the 256 i2c-dev bus limitation.
It should not have any other impact for i2c bus drivers or user space.

This patch has been tested on qemu x86 and qemu powerpc platforms with
the aid of a module which adds and removes 5000 virtual i2c busses, as
well as validated on an existing powerpc hardware platform which makes
use of the i2c bus multiplexing API.
i2c-dev busses with device minor numbers larger than 256 have also been
validated to work with the existing i2c-tools.

Signed-off-by: Erico Nunes &lt;erico.nunes@datacom.ind.br&gt;
[wsa: kept includes sorted]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: i2c-dev: sort includes</title>
<updated>2016-02-20T22:33:38Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-02-20T22:33:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a87660737f66123acf2f0dd2e5994e91b95a2351'/>
<id>urn:sha1:a87660737f66123acf2f0dd2e5994e91b95a2351</id>
<content type='text'>
I request this for drivers, so the core should adhere to sorted includes as
well.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Fix I2C_SLAVE ioctl comment</title>
<updated>2015-10-23T21:26:44Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-09-11T09:27:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9e685c84c266582ad002311497684f183db6b937'/>
<id>urn:sha1:9e685c84c266582ad002311497684f183db6b937</id>
<content type='text'>
The first part of the comment is wrong since November 2007, delete it.

The second part of the comment is related to I2C_PEC, not I2C_SLAVE, so
move it where it belongs.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Fix typo in ioctl name reference</title>
<updated>2015-10-23T21:26:43Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-09-08T09:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c57d3e7a9391c03ae7ee5572be850284393f5bef'/>
<id>urn:sha1:c57d3e7a9391c03ae7ee5572be850284393f5bef</id>
<content type='text'>
The ioctl is named I2C_RDWR for "I2C read/write". But references to it
were misspelled "rdrw". Fix them.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: remove FSF address</title>
<updated>2014-11-07T17:35:33Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2014-11-04T22:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca1f8da9ac5ce6e63d8f6933f83fabc1f3f961f4'/>
<id>urn:sha1:ca1f8da9ac5ce6e63d8f6933f83fabc1f3f961f4</id>
<content type='text'>
We have a central copy of the GPL for that. Some addresses were already
outdated.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
</content>
</entry>
<entry>
<title>i2c: i2c-dev: Create 'name' attribute automatically</title>
<updated>2013-09-30T04:02:31Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2013-09-27T02:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=45f176aea60e9fe8c5fdf8e5c90e5c50c264d86f'/>
<id>urn:sha1:45f176aea60e9fe8c5fdf8e5c90e5c50c264d86f</id>
<content type='text'>
The 'name' attribute is needed for all i2c-dev class devices, meaning
it can be created automatically by pointing to it in the class data
structure. This simplifies the code and reduces the probability for race
conditions (the name attribute should exist by the time the device is
announced to user space).

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
</feed>
