• Jiri Slaby's avatar
    TTY: fix atime/mtime regression · 0b28f586
    Jiri Slaby authored
    commit 37b7f3c7 upstream.
    
    In commit b0de59b5 ("TTY: do not update atime/mtime on read/write")
    we removed timestamps from tty inodes to fix a security issue and waited
    if something breaks.  Well, 'w', the utility to find out logged users
    and their inactivity time broke.  It shows that users are inactive since
    the time they logged in.
    
    To revert to the old behaviour while still preventing attackers to
    guess the password length, we update the timestamps in one-minute
    intervals by this patch.
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    [bwh: For 3.2, use Greg's backported version]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    0b28f586
tty_io.c 82.3 KB