]> git.ipfire.org Git - thirdparty/linux.git/commit
isofs: fix Y2038 and Y2156 issues in Rock Ridge TF entry
authorJonas 'Sortie' Termansen <sortie@maxsi.org>
Fri, 11 Apr 2025 14:50:21 +0000 (16:50 +0200)
committerJan Kara <jack@suse.cz>
Tue, 15 Apr 2025 09:56:57 +0000 (11:56 +0200)
commit5ea45f54c8d6ca2a95b7bd450ee9eb253310bfd3
tree4d092640ed065456dedb1ba6642ed3c3fcefd545
parent0405d4b63d082861f4eaff9d39c78ee9dc34f845
isofs: fix Y2038 and Y2156 issues in Rock Ridge TF entry

This change implements the Rock Ridge TF entry LONG_FORM bit, which uses
the ISO 9660 17-byte date format (up to year 9999, with 10ms precision)
instead of the 7-byte date format (up to year 2155, with 1s precision).

Previously the LONG_FORM bit was ignored; and isofs would entirely
misinterpret the date as the wrong format, resulting in garbage
timestamps on the filesystem.

The Y2038 issue in iso_date() is fixed by returning a struct timespec64
instead of an int.

parse_rock_ridge_inode_internal() is fixed so it does proper bounds
checks of the TF entry timestamps.

Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250411145022.2292255-1-sortie@maxsi.org
fs/isofs/inode.c
fs/isofs/isofs.h
fs/isofs/rock.c
fs/isofs/rock.h
fs/isofs/util.c