lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A6D1D26.10909@cn.fujitsu.com>
Date:	Mon, 27 Jul 2009 11:21:10 +0800
From:	Zhaolei <zhaolei@...fujitsu.com>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Pavel Machek <pavel@....cz>, mingo@...e.hu, tglx@...utronix.de,
	linux-kernel@...r.kernel.org
Subject: Re: Re: [PATCH v3 2/2] Use common localtime/gmtime in fat_time_unix2fat()

OGAWA Hirofumi wrote:
> Zhaolei <zhaolei@...fujitsu.com> writes:
> 
>> +	if (sbi->options.tz_utc) {
>> +		gmtime_r(ts->tv_sec, &tm);
>> +	} else {
>> +		localtime_r(ts->tv_sec, &tm);
>> +	}
> 
> Missing error check.
> 
>> -	/* Jan 1 GMT 00:00:00 1980. But what about another time zone? */
>> -	if (second < UNIX_SECS_1980) {
>> +	/*  FAT can only support year between 1980 to 2107 */
>> +	if (tm.tm_year < 1980 - 1900) {
>>  		*time = 0;
>>  		*date = cpu_to_le16((0 << 9) | (1 << 5) | 1);
>>  		if (time_cs)
>>  			*time_cs = 0;
>>  		return;
>>  	}
>> -#if BITS_PER_LONG == 64
>> -	if (second >= UNIX_SECS_2108) {
>> +	if (tm.tm_year > 2107 - 1900) {
>>  		*time = cpu_to_le16((23 << 11) | (59 << 5) | 29);
>>  		*date = cpu_to_le16((127 << 9) | (12 << 5) | 31);
>>  		if (time_cs)
>>  			*time_cs = 199;
>>  		return;
>>  	}
>> -#endif
> 
> I think tm.tm_year is undefine in case of the error.

Hello, Ogawa-san:

Thanks for your review.
I'll fix them

Thanks
Zhaolei


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ