kern/128934: cd9660 timezone offset sign extension error

J.R. Oldroyd fbsd at
Sun Nov 16 20:40:02 PST 2008

>Number:         128934
>Category:       kern
>Synopsis:       cd9660 timezone offset sign extension error
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 17 04:40:01 UTC 2008
>Originator:     J.R. Oldroyd
>Release:        FreeBSD 7.1-PRERELEASE i386
System: FreeBSD 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #9: Wed Oct 29 21:37:25 EDT 2008 xx at i386
ISO 9660 images with non-GMT timeztamps show double tz offset in areas west of GMT [patch]
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.
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];
 		/* original high sierra misses timezone data */
 		tz = 0;

More information about the freebsd-bugs mailing list