Re: [PATCH v2 1/2] isofs: fix timestamps beyond 2027

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 19-10-17 16:47:48, 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 changes the function argument to a 'u8' array, which
> is defined the same way on all architectures, and unambiguously
> lets us use years until 2155.
> 
> This should be backported to all kernels that might still be
> in use by that date.
> 
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
...
> -int iso_date(char * p, int flag)
> +int iso_date(u8 *p, int flag)
>  {
>  	int year, month, day, hour, minute, second, tz;
>  	int crtime;
>  
> -	year = p[0];
> +	year = (int)(u8)p[0];

The cast seems unnecessary now?

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux