lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210428161318.GX4672@valentin-vidic.from.hr>
Date:   Wed, 28 Apr 2021 18:13:18 +0200
From:   Valentin Vidić <vvidic@...entin-vidic.from.hr>
To:     Hendrik Brueckner <brueckner@...ux.ibm.com>
Cc:     Christian Borntraeger <borntraeger@...ibm.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org, Philipp Kern <pkern@...ian.org>,
        Benjamin Zimmermann <dave@....volkswagen.com>,
        debian-s390@...ts.debian.org,
        Peter Oberparleiter <oberpar@...ux.ibm.com>
Subject: Re: [PATCH v2] s390/sclp_vt220: Fix console name to match device

On Wed, Apr 28, 2021 at 03:38:36PM +0200, Hendrik Brueckner wrote:
> It is been a while ago when working on consoles. However, consoles are
> typically devices without having a device node associated. There is special
> handling for /dev/console wrt. to the preferred console in the tty layer.
> 
> A console device might be associated with a tty device but this is not a
> requirement. For example, consider the net console that streams console
> messages thru UDP and is not associated with a tty.
> 
> Because console and tty are different devices, names can also be different
> which is, unfortunately, the case on s390.
> 
> Therefore my suggestion here is not derive the tty device from the name
> of the console, but rather looking at the associated tty being reported
> as major minor number in /proc/console.

Yes, I see what you mean. Loading netconsole produces a line in
/proc/consoles without the major:minor numbers:

  tty0                 -WU (EC p  )    4:7
  netcon0              -W- (E  p  )

On the other hand /proc/consoles documentation seems to suggest these
are character device names:
https://www.kernel.org/doc/html/latest/filesystems/proc.html#proc-consoles

Since sclp_vt220 seems to be the only know exception we are trying
to solve in that direction now.

If this does not work out, the alternative is as you suggested to take
the major:minor numbers and read the char device name from the symlink:

lrwxrwxrwx 1 root root 0 Apr 28 17:00 /sys/dev/char/4:7 -> ../../devices/virtual/tty/tty7

-- 
Valentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ