linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isofs: fix timestamps beyond 2027
@ 2017-10-19  9:50 Arnd Bergmann
  2017-10-19 11:51 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2017-10-19  9:50 UTC (permalink / raw)
  To: Jan Kara
  Cc: Al Viro, Deepa Dinamani, linux-fsdevel, Arnd Bergmann, stable,
	linux-kernel

isofs uses a 'char' variable to load the number of years since
1900 for an inode timestamp. On architectures that use a signed
char type by default, this results in an invalid date for
anything beyond 2027.

This adds a cast to 'u8' for the year number, which should extend
the shelf life of the file system until 2155.

This should be backported to all kernels that might still be
in use by that date.

Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/isofs/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/isofs/util.c b/fs/isofs/util.c
index 005a15cfd30a..f40796c4c6c2 100644
--- a/fs/isofs/util.c
+++ b/fs/isofs/util.c
@@ -20,7 +20,7 @@ int iso_date(char * p, int flag)
 	int year, month, day, hour, minute, second, tz;
 	int crtime;
 
-	year = p[0];
+	year = (int)(u8)p[0];
 	month = p[1];
 	day = p[2];
 	hour = p[3];
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-19 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19  9:50 [PATCH] isofs: fix timestamps beyond 2027 Arnd Bergmann
2017-10-19 11:51 ` Al Viro
2017-10-19 12:20   ` Anders Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).