<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/serdev, branch v4.15</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-11-28T15:00:50Z</updated>
<entry>
<title>serdev: ttyport: fix tty locking in close</title>
<updated>2017-11-28T15:00:50Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-11-03T14:30:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90dbad8cd6efccbdce109d5ef0724f8434a6cdde'/>
<id>urn:sha1:90dbad8cd6efccbdce109d5ef0724f8434a6cdde</id>
<content type='text'>
Make sure to hold the tty lock as required when calling tty-driver
close() (e.g. to avoid racing with hangup()).

Note that the serport active flag is currently set under the lock at
controller open, but really isn't protected by it.

Fixes: cd6484e1830b ("serdev: Introduce new bus for serial attached devices")
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: ttyport: fix NULL-deref on hangup</title>
<updated>2017-11-28T15:00:50Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-11-03T14:30:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8bcd4e6a8decac251d55c4377e2e67f052777ce0'/>
<id>urn:sha1:8bcd4e6a8decac251d55c4377e2e67f052777ce0</id>
<content type='text'>
Make sure to use a properly refcounted tty_struct in write_wake up to
avoid dereferencing a NULL-pointer when a port is being hung up.

Fixes: bed35c6dfa6a ("serdev: add a tty port controller driver")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.11
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: ttyport: add missing receive_buf sanity checks</title>
<updated>2017-11-28T15:00:50Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-11-03T14:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb281683621b71ab9710d9dccbbef0c2e1769c97'/>
<id>urn:sha1:eb281683621b71ab9710d9dccbbef0c2e1769c97</id>
<content type='text'>
The receive_buf tty-port callback should return the number of bytes
accepted and must specifically never return a negative errno (or a value
larger than the buffer size) to the tty layer.

A serdev driver not providing a receive_buf callback would currently
cause the flush_to_ldisc() worker to spin in a tight loop when the tty
buffer pointers are incremented with -EINVAL (-22) after data has been
received.

A serdev driver occasionally returning a negative errno (or a too large
byte count) could cause information leaks or crashes when accessing
memory outside the tty buffers in consecutive callbacks.

Fixes: cd6484e1830b ("serdev: Introduce new bus for serial attached devices")
Cc: stable &lt;stable@vger.kernel.org&gt;	# 4.11
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serdev: Remove redundant license text</title>
<updated>2017-11-08T12:08:12Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-06T17:11:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e17ff37f185c4abba98afe372cadeac368cde89'/>
<id>urn:sha1:4e17ff37f185c4abba98afe372cadeac368cde89</id>
<content type='text'>
Now that the SPDX tag is in all tty files, that identifies the license
in a specific and legally-defined manner.  So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: add SPDX identifiers to all remaining files in drivers/tty/</title>
<updated>2017-11-08T12:08:12Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-06T17:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e3b3d0f549c1d19b94e6ac55c66643166ea649ef'/>
<id>urn:sha1:e3b3d0f549c1d19b94e6ac55c66643166ea649ef</id>
<content type='text'>
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/tty files files with the correct SPDX license
identifier based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Jiri Slaby &lt;jslaby@suse.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Chris Metcalf &lt;cmetcalf@mellanox.com&gt;
Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: David Sterba &lt;dsterba@suse.com&gt;
Cc: James Hogan &lt;jhogan@kernel.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Ray Jui &lt;rjui@broadcom.com&gt;
Cc: Scott Branden &lt;sbranden@broadcom.com&gt;
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: Joachim Eastwood &lt;manabian@gmail.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Cc: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Cc: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Cc: Baruch Siach &lt;baruch@tkos.co.il&gt;
Cc: "Maciej W. Rozycki" &lt;macro@linux-mips.org&gt;
Cc: "Uwe Kleine-König" &lt;kernel@pengutronix.de&gt;
Cc: Pat Gefre &lt;pfg@sgi.com&gt;
Cc: "Guilherme G. Piccoli" &lt;gpiccoli@linux.vnet.ibm.com&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Cc: Sylvain Lemieux &lt;slemieux.tyco@gmail.com&gt;
Cc: Carlo Caione &lt;carlo@caione.org&gt;
Cc: Kevin Hilman &lt;khilman@baylibre.com&gt;
Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Cc: Andy Gross &lt;andy.gross@linaro.org&gt;
Cc: David Brown &lt;david.brown@linaro.org&gt;
Cc: "Andreas Färber" &lt;afaerber@suse.de&gt;
Cc: Kevin Cernekee &lt;cernekee@gmail.com&gt;
Cc: Laxman Dewangan &lt;ldewangan@nvidia.com&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: Jonathan Hunter &lt;jonathanh@nvidia.com&gt;
Cc: Barry Song &lt;baohua@kernel.org&gt;
Cc: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Cc: Maxime Coquelin &lt;mcoquelin.stm32@gmail.com&gt;
Cc: Alexandre Torgue &lt;alexandre.torgue@st.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Peter Korsgaard &lt;jacmet@sunsite.dk&gt;
Cc: Timur Tabi &lt;timur@tabi.org&gt;
Cc: Tony Prisk &lt;linux@prisktech.co.nz&gt;
Cc: Michal Simek &lt;michal.simek@xilinx.com&gt;
Cc: "Sören Brinkmann" &lt;soren.brinkmann@xilinx.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: Philippe Ombredanne &lt;pombredanne@nexb.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: fix controller-allocation error handling</title>
<updated>2017-10-23T09:25:48Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-10-12T13:28:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=978d6fac5d0617c9722ae1db1accee46776f4400'/>
<id>urn:sha1:978d6fac5d0617c9722ae1db1accee46776f4400</id>
<content type='text'>
Reorder controller initialisation so that in the unlikely event that id
allocation fails, we don't end up releasing id 0 in the destructor.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: fix registration of second slave</title>
<updated>2017-10-23T09:25:33Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-10-10T16:09:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08fcee289f341786eb3b44e5f2d1dc850943238e'/>
<id>urn:sha1:08fcee289f341786eb3b44e5f2d1dc850943238e</id>
<content type='text'>
Serdev currently only supports a single slave device, but the required
sanity checks to prevent further registration attempts were missing.

If a serial-port node has two child nodes with compatible properties,
the OF code would try to register two slave devices using the same id
and name. Driver core will not allow this (and there will be loud
complaints), but the controller's slave pointer would already have been
set to address of the soon to be deallocated second struct
serdev_device. As the first slave device remains registered, this can
lead to later use-after-free issues when the slave callbacks are
accessed.

Note that while the serdev registration helpers are exported, they are
typically only called by serdev core. Any other (out-of-tree) callers
must serialise registration and deregistration themselves.

Fixes: cd6484e1830b ("serdev: Introduce new bus for serial attached devices")
Cc: stable &lt;stable@vger.kernel.org&gt;	# 4.11
Cc: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: ttyport: add missing open() error handling</title>
<updated>2017-10-23T09:24:24Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-10-16T13:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7c63838ea5afb15a60c58a2f0fe8ac093fc9f1a5'/>
<id>urn:sha1:7c63838ea5afb15a60c58a2f0fe8ac093fc9f1a5</id>
<content type='text'>
Add missing error handling for tty-driver open() which may fail (e.g. if
resource allocation fails or if a port is being disconnected).

Note that close() must be called also in case of failed open() and that
the operation sanity check is amended to catch buggy drivers.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: ttyport: enforce tty-driver open() requirement</title>
<updated>2017-10-23T09:24:24Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-10-16T13:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dee7d0f3b200c67c6ee96bd37c6e8fa52690ab56'/>
<id>urn:sha1:dee7d0f3b200c67c6ee96bd37c6e8fa52690ab56</id>
<content type='text'>
The tty-driver open routine is mandatory, but the serdev
tty-port-controller implementation did not treat it as such and would
instead fall back to calling tty_port_open() directly.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serdev: Add ACPI support</title>
<updated>2017-10-20T12:24:44Z</updated>
<author>
<name>Frédéric Danis</name>
<email>frederic.danis.oss@gmail.com</email>
</author>
<published>2017-10-11T08:32:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=53c7626356c7584e82510d86394a6dcd80525614'/>
<id>urn:sha1:53c7626356c7584e82510d86394a6dcd80525614</id>
<content type='text'>
This patch allows SerDev module to manage serial devices declared as
attached to an UART in ACPI table.

acpi_serdev_add_device() callback will only take into account entries
without enumerated flag set. This flags is set for all entries during
ACPI scan, except for SPI and I2C serial devices, and for UART with
2nd patch in the series.

Check if a serdev device as been allocated during acpi_walk_namespace()
to prevent serdev controller registration instead of the tty-class device.

Signed-off-by: Frédéric Danis &lt;frederic.danis.oss@gmail.com&gt;
Reviewed-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.co.uk&gt;
Reviewed-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
