Bug 224436 - vt: CONS_CLRHIST (vidcontrol -C) not implemented
Summary: vt: CONS_CLRHIST (vidcontrol -C) not implemented
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason A. Harmening
URL:
Keywords: vt
Depends on:
Blocks: 231027 203349
  Show dependency treegraph
 
Reported: 2017-12-18 21:00 UTC by Ed Maste
Modified: 2020-06-27 23:08 UTC (History)
2 users (show)

See Also:
emaste: mfc-stable11?
emaste: mfc-stable10-
emaste: mfc-stable9-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2017-12-18 21:00:39 UTC
Steps to reproduce:
% vidcontrol -C

Expected behaviour:
Scrollback cleared (e.g. confirm with ScrLk / PgUp)

Observed behaviour:
% vidcontrol -C
vidcontrol: clearing history buffer: Inappropriate ioctl for device
Comment 1 Daniel_R 2018-06-07 07:20:49 UTC
This bug is security relevant, because it may disclose the content of a session to somebody without an account but physical access to the machine.  They can see parts of the last session simply by scrolling back in the terminal, even without the need to login.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-05-28 21:23:23 UTC
A commit references this bug:

Author: jah
Date: Thu May 28 21:22:31 UTC 2020
New revision: 361601
URL: https://svnweb.freebsd.org/changeset/base/361601

Log:
  vt(4): Add support for `vidcontrol -C'

  Extract scrollback buffer initialization into a common routine, used both
  during vt(4) init and in handling the CONS_CLRHIST ioctl.

  PR:		224436
  Reviewed by:	emaste
  Differential Revision:	https://reviews.freebsd.org/D24815

Changes:
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_buf.c
  head/sys/dev/vt/vt_core.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-06-02 01:22:46 UTC
A commit references this bug:

Author: jah
Date: Tue Jun  2 01:21:48 UTC 2020
New revision: 361719
URL: https://svnweb.freebsd.org/changeset/base/361719

Log:
  vt(4): reset scrollback and cursor position after clearing history buffer

  r361601 implemented basic support for cleaing the console history buffer.
  But after clearing the history buffer, it's not especially useful to be
  able to scroll back through that buffer, or for the cursor position to
  remain at (very likely) the bottom of the screen.

  PR:		224436
  Reviewed by:	emaste
  Differential Revision:	https://reviews.freebsd.org/D25079

Changes:
  head/sys/dev/vt/vt_buf.c
  head/sys/dev/vt/vt_core.c
  head/sys/kern/subr_terminal.c