FS#77575 - /dev/vcs* devices are not functioning correctly

Attached to Project: Arch Linux
Opened by Storm (stormdragon2976) - Sunday, 19 February 2023, 16:24 GMT
Last edited by Toolybird (Toolybird) - Monday, 20 February 2023, 21:35 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:


The /dev/vcs* devices appear to error out after a short time of being accessed. The expected contents appears, but is gone so quickly, it is impossible to copy it and it is replaced by no such device error.


Additional info:
* package version(s)
It is present in linux-lts 5.15.94-1 but others have tested it in latest kernel too. Please note that I only suspect it's a kernel problem and can't be sure.

* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:

[root@mjollnir ~]# cat /dev/vcs

cat: /dev/vcs: No such device or address


[root@mjollnir ~]# cat /dev/vcsa1

cat: /dev/vcsa1: No such device or address

The same behavior happens with /dev/vcsu*. Here is another example to reproduce using python:

[root@mjollnir ~]# python
Python 3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> useVCSU = os.access('/dev/vcsu', os.R_OK)
>>> print(useVCSU)
True
>>> vcsu= open("/dev/vcsu",'rb')
>>> d = vcsu.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 6] No such device or address
>>>
This task depends upon

Closed by  Toolybird (Toolybird)
Monday, 20 February 2023, 21:35 GMT
Reason for closing:  Upstream
Additional comments about closing:  Reporter says "...a fix is in coming..."
Comment by Toolybird (Toolybird) - Sunday, 19 February 2023, 20:21 GMT
For the record, here are the 2 associated mailing list threads [1][2].

The reason why it affects both LTS and current linux is because it appears a security patch was applied to both trees to fix a UAF (use after free) bug.

If that patch is problematic, you should report it upstream to the kernel folks. Maybe even email the patch author directly. It's this patch [3]. Please let us know what you find out.

[1] https://lists.archlinux.org/archives/list/arch-general%40lists.archlinux.org/thread/EOSHIVGUZLNAD7BPHSUGOXFYSAFWDYH7/
[2] https://lists.archlinux.org/archives/list/arch-general%40lists.archlinux.org/thread/S6R6UDUMX2LWL4HJ74MFNYOES45UBFLF/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/tty/vt/vc_screen.c?h=v5.15.94&id=fc9e27f3ba083534b8bbf72ab0f5c810ffdc7d18
Comment by Storm (stormdragon2976) - Monday, 20 February 2023, 20:36 GMT
There is a patch in the works for the kernel. Should be fixed upstream soon. Thanks for the help.

Loading...