From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Anders Larsen To: Al Viro Cc: Arnd Bergmann , Jan Kara , Deepa Dinamani , linux-fsdevel@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] isofs: fix timestamps beyond 2027 Date: Thu, 19 Oct 2017 14:20:31 +0200 Message-ID: <2050954.94H7DoQr5D@alarsen-lx> In-Reply-To: <20171019115104.GR21978@ZenIV.linux.org.uk> References: <20171019095027.588816-1-arnd@arndb.de> <20171019115104.GR21978@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: stable-owner@vger.kernel.org List-ID: On Thursday, 19 October 2017 12:51:05 CEST Al Viro wrote: > On Thu, Oct 19, 2017 at 11:50:18AM +0200, Arnd Bergmann wrote: > > 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 > > --- > > > > 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]; > > This is BS; just turn that > char time[7]; > in struct stamp into > unsigned char time[7]; > and adjust iso_date() accordingly. Or make that > sucker actually take struct stamp *, while we are at it. > > And I'd suggest going through the rest of on-disk structures in > rock.h and looking for other trouble of that sort. There are more candidates in include/uapi/linux/iso_fs.h - most of them seems to be unused (by us), but at the very least struct iso_directory_record contains a date-field of the same sort that is indeed used. Cheers Anders