<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/tty/vt/vt.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-06-09T07:16:15Z</updated>
<entry>
<title>vt/fbcon: deinitialize resources in visual_init() after failed memory allocation</title>
<updated>2019-06-09T07:16:15Z</updated>
<author>
<name>Grzegorz Halat</name>
<email>ghalat@redhat.com</email>
</author>
<published>2019-04-26T14:59:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=863f40c7a7036766c145f09dba6e1545c5eccdb0'/>
<id>urn:sha1:863f40c7a7036766c145f09dba6e1545c5eccdb0</id>
<content type='text'>
commit a1ad1cc9704f64c169261a76e1aee1cf1ae51832 upstream.

After memory allocation failure vc_allocate() doesn't clean up data
which has been initialized in visual_init(). In case of fbcon this
leads to divide-by-0 in fbcon_init() on next open of the same tty.

memory allocation in vc_allocate() may fail here:
1097:     vc-&gt;vc_screenbuf = kzalloc(vc-&gt;vc_screenbuf_size, GFP_KERNEL);

on next open() fbcon_init() skips vc_font.data initialization:
1088:     if (!p-&gt;fontdata) {

division by zero in fbcon_init() happens here:
1149:     new_cols /= vc-&gt;vc_font.width;

Additional check is needed in fbcon_deinit() to prevent
usage of uninitialized vc_screenbuf:

1251:        if (vc-&gt;vc_hi_font_mask &amp;&amp; vc-&gt;vc_screenbuf)
1252:                set_vc_hi_font(vc, false);

Crash:

 #6 [ffffc90001eafa60] divide_error at ffffffff81a00be4
    [exception RIP: fbcon_init+463]
    RIP: ffffffff814b860f  RSP: ffffc90001eafb18  RFLAGS: 00010246
...
 #7 [ffffc90001eafb60] visual_init at ffffffff8154c36e
 #8 [ffffc90001eafb80] vc_allocate at ffffffff8154f53c
 #9 [ffffc90001eafbc8] con_install at ffffffff8154f624
...

Signed-off-by: Grzegorz Halat &lt;ghalat@redhat.com&gt;
Reviewed-by: Oleksandr Natalenko &lt;oleksandr@redhat.com&gt;
Acked-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.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>tty: vt.c: Fix TIOCL_BLANKSCREEN console blanking if blankinterval == 0</title>
<updated>2019-05-22T05:39:52Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-03-04T23:02:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f5eaf86b41442af176d317c56823665f9850939e'/>
<id>urn:sha1:f5eaf86b41442af176d317c56823665f9850939e</id>
<content type='text'>
commit 75ddbc1fb11efac87b611d48e9802f6fe2bb2163 upstream.

Previously, in the userspace, it was possible to use the "setterm" command
from util-linux to blank the VT console by default, using the following
command.

According to the man page,

&gt; The force option keeps the screen blank even if a key is pressed.

It was implemented by calling TIOCL_BLANKSCREEN.

	case BLANKSCREEN:
		ioctlarg = TIOCL_BLANKSCREEN;
		if (ioctl(STDIN_FILENO, TIOCLINUX, &amp;ioctlarg))
			warn(_("cannot force blank"));
		break;

However, after Linux 4.12, this command ceased to work anymore, which is
unexpected. By inspecting the kernel source, it shows that the issue was
triggered by the side-effect from commit a4199f5eb809 ("tty: Disable
default console blanking interval").

The console blanking is implemented by function do_blank_screen() in vt.c:
"blank_state" will be initialized to "blank_normal_wait" in con_init() if
AND ONLY IF ("blankinterval" &gt; 0). If "blankinterval" is 0, "blank_state"
will be "blank_off" (== 0), and a call to do_blank_screen() will always
abort, even if a forced blanking is required from the user by calling
TIOCL_BLANKSCREEN, the console won't be blanked.

This behavior is unexpected from a user's point-of-view, since it's not
mentioned in any documentation. The setterm man page suggests it will
always work, and the kernel comments in uapi/linux/tiocl.h says

&gt; /* keep screen blank even if a key is pressed */
&gt; #define TIOCL_BLANKSCREEN 14

To fix it, we simply remove the "blank_state != blank_off" check, as
pointed out by Nicolas Pitre, this check doesn't logically make sense
and it's safe to remove.

Suggested-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Fixes: a4199f5eb809 ("tty: Disable default console blanking interval")
Signed-off-by: Yifeng Li &lt;tomli@tomli.me&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>vt: fix cursor when clearing the screen</title>
<updated>2019-04-17T12:45:15Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2019-04-05T00:53:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b2ecf00631362a83744e5ec249947620db5e240c'/>
<id>urn:sha1:b2ecf00631362a83744e5ec249947620db5e240c</id>
<content type='text'>
The patch a6dbe4427559 ("vt: perform safe console erase in the right
order") introduced a bug. The conditional do_update_region() was
replaced by a call to update_region() that does contain the conditional
already, but with unwanted extra side effects such as restoring the cursor
drawing.

In order to reproduce the bug:
- use framebuffer console with the AMDGPU driver
- type "links" to start the console www browser
- press 'q' and space to exit links

Now the cursor will be permanently visible in the center of the
screen. It will stay there until something overwrites it.

The bug goes away if we change update_region() back to the conditional
do_update_region().

[ nico: reworded changelog ]

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Reviewed-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Cc: stable@vger.kernel.org
Fixes: a6dbe4427559 ("vt: perform safe console erase in the right order")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: perform safe console erase in the right order</title>
<updated>2019-02-12T09:46:11Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@linaro.org</email>
</author>
<published>2019-02-12T00:36:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a6dbe442755999960ca54a9b8ecfd9606be0ea75'/>
<id>urn:sha1:a6dbe442755999960ca54a9b8ecfd9606be0ea75</id>
<content type='text'>
Commit 4b4ecd9cb853 ("vt: Perform safe console erase only once") removed
what appeared to be an extra call to scr_memsetw(). This missed the fact
that set_origin() must be called before clearing the screen otherwise
old screen content gets restored on the screen when using vgacon. Let's
fix that by moving all the scrollback handling to flush_scrollback()
where it logically belongs, and invoking it before the actual screen
clearing in csi_J(), making the code simpler in the end.

Reported-by: Matthew Whitehead &lt;tedheadster@gmail.com&gt;
Signed-off-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Tested-by: Matthew Whitehead &lt;tedheadster@gmail.com&gt;
Fixes: 4b4ecd9cb853 ("vt: Perform safe console erase only once")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.0-rc4 into tty-next</title>
<updated>2019-01-28T07:22:00Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-01-28T07:22:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=83b21ed0fc2a7b17c6b9d4f72f664841f797380b'/>
<id>urn:sha1:83b21ed0fc2a7b17c6b9d4f72f664841f797380b</id>
<content type='text'>
We need the tty and serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: ignore sequences that contain ':' in parameters.</title>
<updated>2019-01-18T12:57:27Z</updated>
<author>
<name>Martin Hostettler</name>
<email>textshell@uchuujin.de</email>
</author>
<published>2018-12-15T14:34:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=04afcd3aaf3389cc258044350e4daac2410164d8'/>
<id>urn:sha1:04afcd3aaf3389cc258044350e4daac2410164d8</id>
<content type='text'>
csi sequences can contain subparameters delimited by ':' characters. For
now just ignore the whole sequence in this case. Such sequences are used by
more capable terminal implementations with T.416 high color modes or
extended underline rendition attributes.

Also ignore sequences with private use characters '?', '&gt;', '='
and '&gt;' that are not at the initial position.

Signed-off-by: Martin Hostettler &lt;textshell@uchuujin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: ignore csi sequences with intermediate characters.</title>
<updated>2019-01-18T12:57:27Z</updated>
<author>
<name>Martin Hostettler</name>
<email>textshell@uchuujin.de</email>
</author>
<published>2018-12-15T14:34:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7a99565f87321b456e3469b8e256705f605997d5'/>
<id>urn:sha1:7a99565f87321b456e3469b8e256705f605997d5</id>
<content type='text'>
Various csi sequences contain intermediate characters between the
parameters and the final character. Introduce a additional state that
cleanly ignores these sequences.

This allows the vt to ignore these sequences used by more capable
terminal implementations such as "request mode", etc.

Signed-off-by: Martin Hostettler &lt;textshell@uchuujin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: Implement parsing for &gt;, =, &lt; private sequences.</title>
<updated>2019-01-18T12:56:41Z</updated>
<author>
<name>Martin Hostettler</name>
<email>textshell@uchuujin.de</email>
</author>
<published>2018-12-15T14:34:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5445447b62e0cf69a6f8b62df51c1ef6f2cd56fe'/>
<id>urn:sha1:5445447b62e0cf69a6f8b62df51c1ef6f2cd56fe</id>
<content type='text'>
Private sequences can start with '&gt;', '=' and (in theory) '&lt;'.
Implement correct parsing for these. The newly parsable sequences are
cleanly ignored as it is customary with terminal emulators.

This allows the vt to ignore various sequences used by more capable
terminal implementations such as "Secondary Device Attributes",
"Tertiary Device Attributes" and various advanced configuration commands
that don't have dedicated terminfo entries.

Signed-off-by: Martin Hostettler &lt;textshell@uchuujin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: refactor vc_ques to allow of other private sequences.</title>
<updated>2019-01-18T12:52:41Z</updated>
<author>
<name>Martin Hostettler</name>
<email>textshell@uchuujin.de</email>
</author>
<published>2018-12-15T14:34:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2ff5c5a1dc6e6c502e0a3e49db4e792804e43693'/>
<id>urn:sha1:2ff5c5a1dc6e6c502e0a3e49db4e792804e43693</id>
<content type='text'>
The vc_ques keeps track if a csi sequence is a private DEC control
function beginning with '?'. Nowadays some private control functions
begin with '&gt;' and '='. Switch the code to instead use a new 3-bit
vc_priv that allows for all private use parameter prefixes.

Signed-off-by: Martin Hostettler &lt;textshell@uchuujin.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vt: annotate implicit fall throughs</title>
<updated>2019-01-18T12:48:52Z</updated>
<author>
<name>Mathieu Malaterre</name>
<email>malat@debian.org</email>
</author>
<published>2019-01-14T20:41:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=17504fd7db0c6c32fda8c46ff42ddd871b259e54'/>
<id>urn:sha1:17504fd7db0c6c32fda8c46ff42ddd871b259e54</id>
<content type='text'>
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warning:

  drivers/tty/vt/vt.c:2112:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  drivers/tty/vt/vt.c:2237:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Acked-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
