<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/media/rc/lirc_dev.c, branch v4.14.286</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.286</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.286'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-09-05T11:28:59+00:00</updated>
<entry>
<title>media: Revert "[media] lirc_dev: remove superfluous get/put_device() calls"</title>
<updated>2017-09-05T11:28:59+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2017-08-04T14:12:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a607f51e5a4c421e2097077db88105402099c528'/>
<id>urn:sha1:a607f51e5a4c421e2097077db88105402099c528</id>
<content type='text'>
This reverts commit 5be2b76a9ca4ea5fd3e221114d62eeb0d78267ca.

Only when the lirc device is freed, should we drop our reference to
rc_dev, else we the rc_dev is freed to early. If userspace has
a file descriptor open during unplug, it goes bang.

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x7bb/0x1e10
Read of size 8 at addr ffff8801d7d61ed0 by task ir-rec/2609

-snip-
 mutex_lock_nested+0x1b/0x20
 ? mutex_lock_nested+0x1b/0x20
 rc_close.part.6+0x20/0x60 [rc_core]
 rc_close+0x13/0x20 [rc_core]
 lirc_dev_fop_close+0x62/0xd0 [lirc_dev]
 __fput+0x236/0x410
 ? fput+0xb0/0xb0
 ? do_raw_spin_trylock+0x110/0x110
 ? set_rq_offline.part.70+0xa0/0xa0
 ____fput+0xe/0x10
 task_work_run+0x116/0x180
 ? task_work_cancel+0x170/0x170
 ? _raw_spin_unlock+0x27/0x40
 ? switch_task_namespaces+0x5f/0x90
 do_exit+0x68b/0xe80

Cc: stable@vger.kernel.org # For Kernel 4.13
Fixes: 5be2b76a9ca4 ("[media] lirc_dev: remove superfluous get/put_device() calls")
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: cleanup includes</title>
<updated>2017-06-06T12:06:40+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=463015ddb44122d03bbbf8a39cd170a347b2a010'/>
<id>urn:sha1:463015ddb44122d03bbbf8a39cd170a347b2a010</id>
<content type='text'>
Remove superfluous includes and defines.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: return POLLHUP and POLLERR when device is gone</title>
<updated>2017-06-06T12:06:06+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=29debf3d9d214f600af38069e5954699934abe74'/>
<id>urn:sha1:29debf3d9d214f600af38069e5954699934abe74</id>
<content type='text'>
Most drivers return both values when the device is gone.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: remove unused module parameter</title>
<updated>2017-06-06T12:05:35+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e435e572ef9a890512b76b00e42e16f5553ca8f'/>
<id>urn:sha1:8e435e572ef9a890512b76b00e42e16f5553ca8f</id>
<content type='text'>
The "debug" parameter isn't actually used anywhere.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: remove superfluous get/put_device() calls</title>
<updated>2017-06-06T12:05:09+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5be2b76a9ca4ea5fd3e221114d62eeb0d78267ca'/>
<id>urn:sha1:5be2b76a9ca4ea5fd3e221114d62eeb0d78267ca</id>
<content type='text'>
device_add() and friends already manage the references to the parent
device so these calls aren't necessary.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: remove lirc_irctl_init() and lirc_cdev_add()</title>
<updated>2017-06-06T12:04:35+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=712551f0e45d668bd42cf5ce752f02fa0bba63f2'/>
<id>urn:sha1:712551f0e45d668bd42cf5ce752f02fa0bba63f2</id>
<content type='text'>
These two functions only make the logic in lirc_register_driver()
harder to follow.

(Note that almost no other driver calls kobject_set_name() on their cdev
so I simply removed that part).

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: merge lirc_register_driver() and lirc_allocate_driver()</title>
<updated>2017-06-06T12:03:04+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56481f0060a48938e31461efa2ad54d3b293ebe8'/>
<id>urn:sha1:56481f0060a48938e31461efa2ad54d3b293ebe8</id>
<content type='text'>
Merging the two means that lirc_allocate_buffer() is called before
device_add() and cdev_add() which makes more sense. This also
simplifies the locking slightly because lirc_allocate_buffer() will
always be called with lirc_dev_lock held.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: make fops mandatory</title>
<updated>2017-06-06T12:02:20+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0e3c77cc218d754eae9ddcc62d8ede5b31cf7c2'/>
<id>urn:sha1:e0e3c77cc218d754eae9ddcc62d8ede5b31cf7c2</id>
<content type='text'>
Every caller of lirc_register_driver() passes their own fops and there
are no users of lirc_dev_fop_write() in the kernel tree. Thus we can
make fops mandatory and remove lirc_dev_fop_write().

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: clarify error handling</title>
<updated>2017-06-06T12:01:29+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=258232269590cee2acd4bb28b8e027ad340a85f9'/>
<id>urn:sha1:258232269590cee2acd4bb28b8e027ad340a85f9</id>
<content type='text'>
out_sysfs is misleading, sysfs only comes into play after device_add().
Also, calling device_init() before the rest of struct dev is filled out
is clearer.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] lirc_dev: remove sampling kthread</title>
<updated>2017-06-06T12:00:56+00:00</updated>
<author>
<name>David Härdeman</name>
<email>david@hardeman.nu</email>
</author>
<published>2017-05-01T16:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3104e1b42744156c414003043587d128de2b91f'/>
<id>urn:sha1:c3104e1b42744156c414003043587d128de2b91f</id>
<content type='text'>
There are no drivers which use this functionality.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
</feed>
