<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/tty/vt, branch v5.11.9</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.11.9</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.11.9'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-03-07T11:35:49Z</updated>
<entry>
<title>vt/consolemap: do font sum unsigned</title>
<updated>2021-03-07T11:35:49Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2021-01-05T12:02:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=aac502009fef30db809e97ee186fb0e927a2c28e'/>
<id>urn:sha1:aac502009fef30db809e97ee186fb0e927a2c28e</id>
<content type='text'>
[ Upstream commit 9777f8e60e718f7b022a94f2524f967d8def1931 ]

The constant 20 makes the font sum computation signed which can lead to
sign extensions and signed wraps. It's not much of a problem as we build
with -fno-strict-overflow. But if we ever decide not to, be ready, so
switch the constant to unsigned.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20210105120239.28031-7-jslaby@suse.cz
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>tty: Fix whitespace inconsistencies in vt_io_ioctl</title>
<updated>2020-12-09T14:35:43Z</updated>
<author>
<name>Yan.Gao</name>
<email>gao.yanB@h3c.com</email>
</author>
<published>2020-12-09T03:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fa26b3263fd5f58a7f0cd7b3c6cea75ce714f87b'/>
<id>urn:sha1:fa26b3263fd5f58a7f0cd7b3c6cea75ce714f87b</id>
<content type='text'>
Replaces spaces with tabs for indentation.

Signed-off-by: Yan.Gao &lt;gao.yanB@h3c.com&gt;
Link: https://lore.kernel.org/r/20201209030551.48029-1-gao.yanB@h3c.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: keyboard, make use of assign_bit() API</title>
<updated>2020-11-12T08:43:51Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-11-09T10:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cb215da8369cbbbe3b6260b2ca43518f884ddc6b'/>
<id>urn:sha1:cb215da8369cbbbe3b6260b2ca43518f884ddc6b</id>
<content type='text'>
We have for some time the assign_bit() API to replace open coded

	if (foo)
		set_bit(n, bar);
	else
		clear_bit(n, bar);

Use this API in VT keyboard library code.

Acked-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20201109105601.47159-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: keyboard, replace numbers with \r, \n where appropriate</title>
<updated>2020-11-12T08:43:51Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-11-09T10:56:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6d2c52a83b926bdfc0e4311041459306eac7c48b'/>
<id>urn:sha1:6d2c52a83b926bdfc0e4311041459306eac7c48b</id>
<content type='text'>
Instead of 10, 13 use \n, \r respectively.

Acked-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20201109105601.47159-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: keyboard, use BIT() macro instead of open coded variants</title>
<updated>2020-11-12T08:43:50Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-11-09T10:55:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c050a97d05740609794f3da38f1be8ec4a65157d'/>
<id>urn:sha1:c050a97d05740609794f3da38f1be8ec4a65157d</id>
<content type='text'>
There are few places when BIT() macro is suitable and makes code
easier to understand.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20201109105601.47159-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.10-rc3 into tty-next</title>
<updated>2020-11-09T09:37:10Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2020-11-09T09:37:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9b085d6e889076928d307f05cabf76e35db1e63b'/>
<id>urn:sha1:9b085d6e889076928d307f05cabf76e35db1e63b</id>
<content type='text'>
We need the TTY/vt/serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2020-11-08T19:28:08Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-11-08T19:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bbc821849eba179e62bbe2adba19a87c7686c27b'/>
<id>urn:sha1:bbc821849eba179e62bbe2adba19a87c7686c27b</id>
<content type='text'>
Pull tty/serial fixes from Greg KH:
 "Here are a small number of small tty and serial fixes for some
  reported problems for the tty core, vt code, and some serial drivers.

  They include fixes for:

   - a buggy and obsolete vt font ioctl removal

   - 8250_mtk serial baudrate runtime warnings

   - imx serial earlycon build configuration fix

   - txx9 serial driver error path cleanup issues

   - tty core fix in release_tty that can be triggered by trying to bind
     an invalid serial port name to a speakup console device

  Almost all of these have been in linux-next without any problems, the
  only one that hasn't, just deletes code :)"

* tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  vt: Disable KD_FONT_OP_COPY
  tty: fix crash in release_tty if tty-&gt;port is not set
  serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
  tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled
  serial: 8250_mtk: Fix uart_get_baud_rate warning
</content>
</entry>
<entry>
<title>vt: Disable KD_FONT_OP_COPY</title>
<updated>2020-11-08T18:35:06Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-11-08T15:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3c4e0dff2095c579b142d5a0693257f1c58b4804'/>
<id>urn:sha1:3c4e0dff2095c579b142d5a0693257f1c58b4804</id>
<content type='text'>
It's buggy:

On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
&gt; We recently discovered a slab-out-of-bounds read in fbcon in the latest
&gt; kernel ( v5.10-rc2 for now ).  The root cause of this vulnerability is that
&gt; "fbcon_do_set_font" did not handle "vc-&gt;vc_font.data" and
&gt; "vc-&gt;vc_font.height" correctly, and the patch
&gt; &lt;https://lkml.org/lkml/2020/9/27/223&gt; for VT_RESIZEX can't handle this
&gt; issue.
&gt;
&gt; Specifically, we use KD_FONT_OP_SET to set a small font.data for tty6, and
&gt; use  KD_FONT_OP_SET again to set a large font.height for tty1. After that,
&gt; we use KD_FONT_OP_COPY to assign tty6's vc_font.data to tty1's vc_font.data
&gt; in "fbcon_do_set_font", while tty1 retains the original larger
&gt; height. Obviously, this will cause an out-of-bounds read, because we can
&gt; access a smaller vc_font.data with a larger vc_font.height.

Further there was only one user ever.
- Android's loadfont, busybox and console-tools only ever use OP_GET
  and OP_SET
- fbset documentation only mentions the kernel cmdline font: option,
  not anything else.
- systemd used OP_COPY before release 232 published in Nov 2016

Now unfortunately the crucial report seems to have gone down with
gmane, and the commit message doesn't say much. But the pull request
hints at OP_COPY being broken

https://github.com/systemd/systemd/pull/3651

So in other words, this never worked, and the only project which
foolishly every tried to use it, realized that rather quickly too.

Instead of trying to fix security issues here on dead code by adding
missing checks, fix the entire thing by removing the functionality.

Note that systemd code using the OP_COPY function ignored the return
value, so it doesn't matter what we're doing here really - just in
case a lone server somewhere happens to be extremely unlucky and
running an affected old version of systemd. The relevant code from
font_copy_to_all_vcs() in systemd was:

	/* copy font from active VT, where the font was uploaded to */
	cfo.op = KD_FONT_OP_COPY;
	cfo.height = vcs.v_active-1; /* tty1 == index 0 */
	(void) ioctl(vcfd, KDFONTOP, &amp;cfo);

Note this just disables the ioctl, garbage collecting the now unused
callbacks is left for -next.

v2: Tetsuo found the old mail, which allowed me to find it on another
archive. Add the link too.

Acked-by: Peilin Ye &lt;yepeilin.cs@gmail.com&gt;
Reported-by: Minh Yuan &lt;yuanmingbuaa@gmail.com&gt;
References: https://lists.freedesktop.org/archives/systemd-devel/2016-June/036935.html
References: https://github.com/systemd/systemd/pull/3651
Cc: Greg KH &lt;greg@kroah.com&gt;
Cc: Peilin Ye &lt;yepeilin.cs@gmail.com&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@i-love.sakura.ne.jp&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://lore.kernel.org/r/20201108153806.3140315-1-daniel.vetter@ffwll.ch
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: vt: consolemap: Demote weakly documented function header</title>
<updated>2020-11-06T09:49:27Z</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2020-11-04T19:35:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d3e3232e7b588439d0651f1e6cf8f91c7ccdd186'/>
<id>urn:sha1:d3e3232e7b588439d0651f1e6cf8f91c7ccdd186</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'ct' not described in 'con_get_unimap'
 drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'uct' not described in 'con_get_unimap'
 drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'list' not described in 'con_get_unimap'

Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Cc: Jakub Jelinek &lt;jj@ultra.linux.cz&gt;
Cc: Stanislav Voronyi &lt;stas@cnti.uanet.kharkov.ua&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20201104193549.4026187-10-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: keyboard, use tty_insert_flip_string in puts_queue</title>
<updated>2020-11-04T15:43:39Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2020-10-29T11:32:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c35f638fc2adbb9c439ce68b559d406387cbdbe8'/>
<id>urn:sha1:c35f638fc2adbb9c439ce68b559d406387cbdbe8</id>
<content type='text'>
'puts_queue' currently loops over characters and employs the full tty
buffer machinery for every character. Do the buffer allocation only once
and copy all the character at once. This is achieved using
tty_insert_flip_string instead of loop+tty_insert_flip_char.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20201029113222.32640-17-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
