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-next>] [day] [month] [year] [list]
Message-Id: <20220118044259.764945-1-walt@drummond.us>
Date:   Mon, 17 Jan 2022 20:42:57 -0800
From:   Walt Drummond <walt@...mmond.us>
To:     agordeev@...ux.ibm.com, arnd@...db.de, benh@...nel.crashing.org,
        borntraeger@...ux.ibm.com, chris@...kel.net, davem@...emloft.net,
        gregkh@...uxfoundation.org, hca@...ux.ibm.com, deller@....de,
        ink@...assic.park.msu.ru, James.Bottomley@...senPartnership.com,
        jirislaby@...nel.org, mattst88@...il.com, jcmvbkbc@...il.com,
        mpe@...erman.id.au, paulus@...ba.org, rth@...ddle.net,
        dalias@...c.org, tsbogend@...ha.franken.de, gor@...ux.ibm.com,
        ysato@...rs.osdn.me
Cc:     linux-kernel@...r.kernel.org, ar@...msu.ru, walt@...mmond.us,
        linux-alpha@...r.kernel.org, linux-arch@...r.kernel.org,
        linux-ia64@...r.kernel.org, linux-mips@...r.kernel.org,
        linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        linux-s390@...r.kernel.org, linux-sh@...r.kernel.org,
        linux-xtensa@...ux-xtensa.org, sparclinux@...r.kernel.org
Subject: [PATCH 0/3] status: TTY status message request

This patchset adds TTY status message request feature to the n_tty
line dicipline.  This feature prints a brief message containing basic
system and process group information to a user's TTY in response to a
new control character in the line dicipline (default Ctrl-T) or the
TIOCSTAT ioctl.  The message contains the current system load, the
name and PID of an interesting process in the forground process group,
it's run time, percent CPU usage and RSS.  An example of this message
is:

  load: 0.31  cmd: sleep 3616843 [sleeping] 0.36r 0.00u 0.00s 0% 696k

User API visible changes are limited to:
 - The addition of VSTATUS in termios.c_cc[]
 - The addition of NOKERNINFO bit in termios.l_cflags
 - The addition of the TIOCSTAT ioctl number

None of these changes break the existing kernel api as the termios
structure on all architectures has enough space in the control
character array (.c_cc) for the new character, and the other changes
are space agnostic.

This feature is in many other Unix-like systems, both current and
historical.  In other implementations, this feature would also send
SIGINFO to the process group; this implementation does not.

Walt Drummond (3):
  vstatus: Allow the n_tty line dicipline to write to a user tty
  vstatus: Add user space API definitions for VSTATUS, NOKERNINFO and
    TIOCSTAT
  status: Display an informational message when the VSTATUS character is
    pressed or TIOCSTAT ioctl is called.

 arch/alpha/include/asm/termios.h         |   4 +-
 arch/alpha/include/uapi/asm/ioctls.h     |   1 +
 arch/alpha/include/uapi/asm/termbits.h   |  34 ++---
 arch/ia64/include/asm/termios.h          |   4 +-
 arch/ia64/include/uapi/asm/termbits.h    |  34 ++---
 arch/mips/include/asm/termios.h          |   4 +-
 arch/mips/include/uapi/asm/ioctls.h      |   1 +
 arch/mips/include/uapi/asm/termbits.h    |  36 ++---
 arch/parisc/include/asm/termios.h        |   4 +-
 arch/parisc/include/uapi/asm/ioctls.h    |   1 +
 arch/parisc/include/uapi/asm/termbits.h  |  34 ++---
 arch/powerpc/include/asm/termios.h       |   4 +-
 arch/powerpc/include/uapi/asm/ioctls.h   |   2 +
 arch/powerpc/include/uapi/asm/termbits.h |  34 ++---
 arch/s390/include/asm/termios.h          |   4 +-
 arch/sh/include/uapi/asm/ioctls.h        |   1 +
 arch/sparc/include/uapi/asm/ioctls.h     |   1 +
 arch/sparc/include/uapi/asm/termbits.h   |  38 +++---
 arch/xtensa/include/uapi/asm/ioctls.h    |   1 +
 drivers/tty/Makefile                     |   2 +-
 drivers/tty/n_tty.c                      | 113 +++++++++++-----
 drivers/tty/n_tty_status.c               | 162 +++++++++++++++++++++++
 drivers/tty/tty_io.c                     |   2 +-
 include/asm-generic/termios.h            |   4 +-
 include/linux/tty.h                      | 123 ++++++++---------
 include/uapi/asm-generic/ioctls.h        |   1 +
 include/uapi/asm-generic/termbits.h      |  34 ++---
 27 files changed, 461 insertions(+), 222 deletions(-)
 create mode 100644 drivers/tty/n_tty_status.c

-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ