<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/misc/appledisplay.c, branch v4.9.331</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-11-28T17:29:05+00:00</updated>
<entry>
<title>appledisplay: fix error handling in the scheduled work</title>
<updated>2019-11-28T17:29:05+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2019-11-06T12:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28b06dc3e53970fe82ee1e5b8bbc74cb73f08909'/>
<id>urn:sha1:28b06dc3e53970fe82ee1e5b8bbc74cb73f08909</id>
<content type='text'>
commit 91feb01596e5efc0cc922cc73f5583114dccf4d2 upstream.

The work item can operate on

1. stale memory left over from the last transfer
the actual length of the data transfered needs to be checked
2. memory already freed
the error handling in appledisplay_probe() needs
to cancel the work in that case

Reported-and-tested-by: syzbot+495dab1f175edc9c2f13@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20191106124902.7765-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: misc: appledisplay: fix backlight update_status return code</title>
<updated>2019-11-28T17:28:30+00:00</updated>
<author>
<name>Mattias Jacobsson</name>
<email>2pi@mok.nu</email>
</author>
<published>2018-10-16T12:20:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a2784901a5bb8211221e3079bb37a94f330591c7'/>
<id>urn:sha1:a2784901a5bb8211221e3079bb37a94f330591c7</id>
<content type='text'>
[ Upstream commit 090158555ff8d194a98616034100b16697dd80d0 ]

Upon success the update_status handler returns a positive number
corresponding to the number of bytes transferred by usb_control_msg.
However the return code of the update_status handler should indicate if
an error occurred(negative) or how many bytes of the user's input to sysfs
that was consumed. Return code zero indicates all bytes were consumed.

The bug can for example result in the update_status handler being called
twice, the second time with only the "unconsumed" part of the user's input
to sysfs. Effectively setting an incorrect brightness.

Change the update_status handler to return zero for all successful
transactions and forward usb_control_msg's error code upon failure.

Signed-off-by: Mattias Jacobsson &lt;2pi@mok.nu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: appledisplay: Add 27" Apple Cinema Display</title>
<updated>2018-12-13T08:20:27+00:00</updated>
<author>
<name>Alexander Theissen</name>
<email>alex.theissen@me.com</email>
</author>
<published>2018-12-04T22:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c037e8873e921758284caf62670c0c059ff5db80'/>
<id>urn:sha1:c037e8873e921758284caf62670c0c059ff5db80</id>
<content type='text'>
commit d7859905301880ad3e16272399d26900af3ac496 upstream.

Add another Apple Cinema Display to the list of supported displays.

Signed-off-by: Alexander Theissen &lt;alex.theissen@me.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: misc: appledisplay: add 20" Apple Cinema Display</title>
<updated>2018-11-27T15:09:41+00:00</updated>
<author>
<name>Mattias Jacobsson</name>
<email>2pi@mok.nu</email>
</author>
<published>2018-10-21T09:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fdddfd7fbe522d08ff2d7984a3a28e018ca4b09a'/>
<id>urn:sha1:fdddfd7fbe522d08ff2d7984a3a28e018ca4b09a</id>
<content type='text'>
commit f6501f49199097b99e4e263644d88c90d1ec1060 upstream.

Add another Apple Cinema Display to the list of supported displays

Signed-off-by: Mattias Jacobsson &lt;2pi@mok.nu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: misc: appledisplay: don't print on ENOMEM</title>
<updated>2016-08-30T17:17:37+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa-dev@sang-engineering.com</email>
</author>
<published>2016-08-25T17:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d7f040e92fa0465ff08d2a1e46f0149d9eb65616'/>
<id>urn:sha1:d7f040e92fa0465ff08d2a1e46f0149d9eb65616</id>
<content type='text'>
All kmalloc-based functions print enough information on failures.

Signed-off-by: Wolfram Sang &lt;wsa-dev@sang-engineering.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: appledisplay: don't print error when allocating urb fails</title>
<updated>2016-08-15T13:54:26+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa-dev@sang-engineering.com</email>
</author>
<published>2016-08-11T21:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c6b1caaf2a6446516b5c8620d423ea2593142f03'/>
<id>urn:sha1:c6b1caaf2a6446516b5c8620d423ea2593142f03</id>
<content type='text'>
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang &lt;wsa-dev@sang-engineering.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: appledisplay: Remove deprecated create_singlethread_workqueue</title>
<updated>2016-08-09T13:49:01+00:00</updated>
<author>
<name>Bhaktipriya Shridhar</name>
<email>bhaktipriya96@gmail.com</email>
</author>
<published>2016-07-26T16:49:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a0bb4348bb4b6cce1bb06ac8fa38fc4fb0d9088'/>
<id>urn:sha1:6a0bb4348bb4b6cce1bb06ac8fa38fc4fb0d9088</id>
<content type='text'>
The workqueue "wq" is involved in controlling the brightness of an
Apple Cinema Display over USB.

It has a single work item(&amp;pdata-&gt;work) per appledisplay and hence
doesn't require ordering. Also, it is not being used on a memory
reclaim path.

Hence, the singlethreaded workqueue has been replaced with the use of
system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

The work item is self-requeueing and needs to wait for the in-flight
work item to finish before proceeding with destruction.
Hence, it has been sync cancelled in appledisplay_disconnect().
This also ensures that there are no pending tasks while disconnecting
the driver.

Signed-off-by: Bhaktipriya Shridhar &lt;bhaktipriya96@gmail.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>USB: appledisplay: Deletion of a check before backlight_device_unregister()</title>
<updated>2015-03-18T15:56:40+00:00</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2015-02-05T15:07:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c60b89aa3640ac4eb279213d93828a8100acb6b5'/>
<id>urn:sha1:c60b89aa3640ac4eb279213d93828a8100acb6b5</id>
<content type='text'>
The backlight_device_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: appledisplay: fix race between reading and writing from the device</title>
<updated>2014-05-27T23:03:57+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.de</email>
</author>
<published>2014-05-19T11:53:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=552e1f2679b7b766b8b8de3dc6d83d9cd28f28b2'/>
<id>urn:sha1:552e1f2679b7b766b8b8de3dc6d83d9cd28f28b2</id>
<content type='text'>
The workqueue handler may call appledisplay_bl_get_brightness() while
user space calls appledisplay_bl_update_status(). As they share a
buffer that must not happen. Use a mutex for mutual exclusion.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: appledisplay: Convert /n to \n</title>
<updated>2014-05-27T22:00:22+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2014-04-25T01:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e2b86c1d39d03f566514160d2e8b63e4645095d0'/>
<id>urn:sha1:e2b86c1d39d03f566514160d2e8b63e4645095d0</id>
<content type='text'>
Use a newline character appropriately.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
