11 Jun, 2009

1 commit

  • Long long ago a 4K kmalloc allocated two pages so the tty layer used the
    page allocator, except on some machines where the page size was huge. This was
    removed from the core tty layer with the tty buffer re-implementation but not
    from tty_audit or the n_tty ldisc.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

01 Apr, 2009

1 commit


09 Dec, 2008

1 commit

  • AUDIT_TTY records currently log all data read by processes marked for
    TTY input auditing, even if the data was "pushed back" using the TIOCSTI
    ioctl, not typed by the user.

    This patch records all TIOCSTI calls to disambiguate the input. It
    generates one audit message per character pushed back; considering
    TIOCSTI is used very rarely, this simple solution is probably good
    enough. (The only program I could find that uses TIOCSTI is mailx/nail
    in "header editing" mode, e.g. using the ~h escape. mailx is used very
    rarely, and the escapes are used even rarer.)

    Signed-Off-By: Miloslav Trmac
    Signed-off-by: Al Viro
    Signed-off-by: James Morris

    Al Viro
     

14 Nov, 2008

1 commit

  • Wrap access to task credentials so that they can be separated more easily from
    the task_struct during the introduction of COW creds.

    Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

    Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
    sense to use RCU directly rather than a convenient wrapper; these will be
    addressed by later patches.

    Signed-off-by: David Howells
    Reviewed-by: James Morris
    Acked-by: Serge Hallyn
    Cc: Alan Cox
    Signed-off-by: James Morris

    David Howells
     

14 Oct, 2008

1 commit

  • Data read from a TTY can contain an embedded NUL byte (e.g. after
    pressing Ctrl-2, or sent to a PTY). After the previous patch, the data
    would be logged only up to the first NUL.

    This patch modifies the AUDIT_TTY record to always use the hexadecimal
    format, which does not terminate at the first NUL byte. The vast
    majority of recorded TTY input data will contain either ' ' or '\n', so
    the hexadecimal format would have been used anyway.

    Signed-off-by: Miloslav Trmac
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Miloslav Trmac
     

02 May, 2008

1 commit


28 Apr, 2008

3 commits

  • Remove the code that automatically disables TTY input auditing in processes
    that open TTYs when they have no other TTY open; this heuristic was
    intended to automatically handle daemons, but it has false positives (e.g.
    with sshd) that make it impossible to control TTY input auditing from a PAM
    module. With this patch, TTY input auditing is controlled from user-space
    only.

    On the other hand, not even for daemons does it make sense to audit "input"
    from PTY masters; this data was produced by a program writing to the PTY
    slave, and does not represent data entered by the user.

    Signed-off-by: Miloslav Trmac
    Cc: Al Viro
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Miloslav Trmac
     
  • This patch standardized the string auditing interfaces. No userspace
    changes will be visible and this is all just cleanup and consistancy
    work. We have the following string audit interfaces to use:

    void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, size_t len);

    void audit_log_n_string(struct audit_buffer *ab, const char *buf, size_t n);
    void audit_log_string(struct audit_buffer *ab, const char *buf);

    void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, size_t n);
    void audit_log_untrustedstring(struct audit_buffer *ab, const char *string);

    This may be the first step to possibly fixing some of the issues that
    people have with the string output from the kernel audit system. But we
    still don't have an agreed upon solution to that problem.

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     
  • Previously I added sessionid output to all audit messages where it was
    available but we still didn't know the sessionid of the sender of
    netlink messages. This patch adds that information to netlink messages
    so we can audit who sent netlink messages.

    Signed-off-by: Eric Paris
    Signed-off-by: Al Viro

    Eric Paris
     

09 Feb, 2008

1 commit


02 Feb, 2008

2 commits


17 Jul, 2007

1 commit

  • Add TTY input auditing, used to audit system administrator's actions. This is
    required by various security standards such as DCID 6/3 and PCI to provide
    non-repudiation of administrator's actions and to allow a review of past
    actions if the administrator seems to overstep their duties or if the system
    becomes misconfigured for unknown reasons. These requirements do not make it
    necessary to audit TTY output as well.

    Compared to an user-space keylogger, this approach records TTY input using the
    audit subsystem, correlated with other audit events, and it is completely
    transparent to the user-space application (e.g. the console ioctls still
    work).

    TTY input auditing works on a higher level than auditing all system calls
    within the session, which would produce an overwhelming amount of mostly
    useless audit events.

    Add an "audit_tty" attribute, inherited across fork (). Data read from TTYs
    by process with the attribute is sent to the audit subsystem by the kernel.
    The audit netlink interface is extended to allow modifying the audit_tty
    attribute, and to allow sending explanatory audit events from user-space (for
    example, a shell might send an event containing the final command, after the
    interactive command-line editing and history expansion is performed, which
    might be difficult to decipher from the TTY input alone).

    Because the "audit_tty" attribute is inherited across fork (), it would be set
    e.g. for sshd restarted within an audited session. To prevent this, the
    audit_tty attribute is cleared when a process with no open TTY file
    descriptors (e.g. after daemon startup) opens a TTY.

    See https://www.redhat.com/archives/linux-audit/2007-June/msg00000.html for a
    more detailed rationale document for an older version of this patch.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Miloslav Trmac
    Cc: Al Viro
    Cc: Alan Cox
    Cc: Paul Fulghum
    Cc: Casey Schaufler
    Cc: Steve Grubb
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miloslav Trmac