kernel-hacking-2024-linux-s.../drivers/tty
Jiri Slaby f0bf0bd079 tty: fix up atime/mtime mess, take four
This problem was taken care of three times already in
* b0de59b573 (TTY: do not update
  atime/mtime on read/write),
* 37b7f3c765 (TTY: fix atime/mtime
  regression), and
* b0b885657b (tty: fix up atime/mtime
  mess, take three)

But it still misses one point. As John Paul correctly points out, we
do not care about setting date. If somebody ever changes wall
time backwards (by mistake for example), tty timestamps are never
updated until the original wall time passes.

So check the absolute difference of times and if it large than "8
seconds or so", always update the time. That means we will update
immediatelly when changing time. Ergo, CAP_SYS_TIME can foul the
check, but it was always that way.

Thanks John for serving me this so nicely debugged.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: John Paul Perry <john_paul.perry@alcatel-lucent.com>
Cc: <stable@vger.kernel.org> # all, as b0b885657 was backported
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07 03:06:51 +01:00
..
hvc s390/hvc_iucv: add simple wildcard matches to the iucv allow filter 2015-01-22 12:16:56 +01:00
ipwireless
serial serial: 8250_dw: Fix get_mctrl behaviour 2015-03-07 03:06:51 +01:00
vt vt: provide notifications on selection changes 2015-02-02 10:09:54 -08:00
amiserial.c TTY: fix misspelling of current function in string 2015-01-09 14:38:15 -08:00
bfin_jtag_comm.c
cyclades.c
ehv_bytechan.c tty: remove unused variable sprop 2015-02-03 15:52:13 -08:00
goldfish.c
isicom.c tty/isicom: fix big-endian compile warning 2015-02-02 10:11:25 -08:00
Kconfig
Makefile
metag_da.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c
n_hdlc.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c n_tty: Fix signal handling flushes 2015-02-02 10:11:27 -08:00
nozomi.c
pty.c n_tty: Fix signal handling flushes 2015-02-02 10:11:27 -08:00
rocket.c TTY: fix misspelling of current function in string 2015-01-09 14:38:15 -08:00
rocket.h
rocket_int.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c oom, PM: make OOM detection in the freezer path raceless 2015-02-11 17:06:03 -08:00
tty_audit.c
tty_buffer.c pty: Fix buffer flush deadlock 2015-02-02 10:11:27 -08:00
tty_io.c tty: fix up atime/mtime mess, take four 2015-03-07 03:06:51 +01:00
tty_ioctl.c tty: Remove external interface for tty_set_termios() 2015-02-02 10:11:28 -08:00
tty_ldisc.c
tty_ldsem.c
tty_mutex.c tty: Make lock subclasses available for other tty locks 2015-02-02 10:11:27 -08:00
tty_port.c tty: Deletion of unnecessary checks before two function calls 2014-11-26 19:35:49 -08:00