Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2008 23:35:30 -0500 (EST)
From:      "J.R. Oldroyd" <fbsd@opal.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/128934: cd9660 timezone offset sign extension error
Message-ID:  <200811170435.mAH4ZUw9079321@vougeot.opal.com>
Resent-Message-ID: <200811170440.mAH4e1kH052914@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         128934
>Category:       kern
>Synopsis:       cd9660 timezone offset sign extension error
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 17 04:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     J.R. Oldroyd
>Release:        FreeBSD 7.1-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD vougeot.opal.com 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #9: Wed Oct 29 21:37:25 EDT 2008 xx@vougeot.opal.com:/usr/src/sys/i386/compile/VOUGEOT i386
>Description:
ISO 9660 images with non-GMT timeztamps show double tz offset in areas west of GMT [patch]
>How-To-Repeat:
Set timezone to anything west of GMT.
Create an ISO image using a libisofs application, e.g., xorriso or xfburn.
Mount ISO image.
Examine file timestamps.  They will show 2x GMT offset.
>Fix:
Problem is that libisofs writes file timestamps in the ISO image using
local time together with the GMT offset, as is permitted by ISO standard.
Code in cd9660 driver treats GMT offset value as unsigned, then converts
to signed without cast causing sign-extension and invalid timezone value
which is then ignored.  Effect is file timestamps are not corrected
for timezone info in ISO.

The simple patch below fixes it.

--- fs/cd9660/cd9660_node.c.orig	2007-02-11 08:54:25.000000000 -0500
+++ fs/cd9660/cd9660_node.c	2008-11-15 12:30:19.000000000 -0500
@@ -242,7 +242,7 @@
 	minute = pi[4];
 	second = pi[5];
 	if(ftype != ISO_FTYPE_HIGH_SIERRA)
-		tz = pi[6];
+		tz = ((char *) pi)[6];
 	else
 		/* original high sierra misses timezone data */
 		tz = 0;
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811170435.mAH4ZUw9079321>