]> git.baikalelectronics.ru Git - kernel.git/commit
tpm: tpm1_bios_measurements_next should increase position index
authorVasily Averin <vvs@virtuozzo.com>
Tue, 25 Feb 2020 06:26:08 +0000 (09:26 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 13 Mar 2020 01:53:16 +0000 (03:53 +0200)
commiteccab63068df08a89fe8089fd92355bca426c34a
tree830a7fd0417c11d5e1d85cd34e00df55dfd3688a
parent16b5490e63d11c3b2819a1708802ed19f62a790c
tpm: tpm1_bios_measurements_next should increase position index

If .next function does not change position index,
following .show function will repeat output related
to current position index.

In case of /sys/kernel/security/tpm0/ascii_bios_measurements
and binary_bios_measurements:
1) read after lseek beyound end of file generates whole last line.
2) read after lseek to middle of last line generates
expected end of last line and unexpected whole last line once again.

Cc: stable@vger.kernel.org # 4.19.x
Fixes: 46cb04d471b6 ("fs/seq_file.c: simplify seq_file iteration code ...")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/eventlog/tpm1.c