From wera0003@hs-karlsruhe.de  Wed Jul  8 16:04:53 2009
Return-Path: <wera0003@hs-karlsruhe.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B78D1065674
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Jul 2009 16:04:53 +0000 (UTC)
	(envelope-from wera0003@hs-karlsruhe.de)
Received: from rz06.hs-karlsruhe.de (rz06.HS-Karlsruhe.DE [193.196.64.6])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CA778FC21
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Jul 2009 16:04:53 +0000 (UTC)
	(envelope-from wera0003@hs-karlsruhe.de)
Received: from rz-wenk1.hs-karlsruhe.de ([193.196.65.46])
	by rz06.hs-karlsruhe.de with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.68)
	(envelope-from <wera0003@hs-karlsruhe.de>)
	id 1MOZ3M-0010Pm-2F; Wed, 08 Jul 2009 17:27:24 +0200
Received: from wera0003 by RZ-Wenk1.HS-Karlsruhe.DE with local (Exim 4.69 (FreeBSD))
	(envelope-from <wera0003@hs-karlsruhe.de>)
	id 1MOZ3L-0008AI-F6; Wed, 08 Jul 2009 17:27:23 +0200
Message-Id: <E1MOZ3L-0008AI-F6@RZ-Wenk1.HS-Karlsruhe.DE>
Date: Wed, 08 Jul 2009 17:27:23 +0200
From: Ralf Wenk <IZ-FreeBSD0902-nospam@hs-karlsruhe.de>
Reply-To: Ralf Wenk <IZ-FreeBSD0902-nospam@hs-karlsruhe.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Ralf Wenk <IZ-FreeBSD0902-nospam@hs-karlsruhe.de>
Subject: glabel destroys access to GEOM tree if volume label contains non ASCII characters
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         136467
>Category:       kern
>Synopsis:       [geom] glabel(8) destroys access to GEOM tree if volume label contains non ASCII characters
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 08 16:10:04 UTC 2009
>Closed-Date:    Wed Aug 12 21:01:04 UTC 2009
>Last-Modified:  Wed Aug 12 21:01:04 UTC 2009
>Originator:     Ralf Wenk
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
Hochschule Karlsruhe, University of Applied Sciences
>Environment:
System: FreeBSD ptavv.ka.sub.org 7.2-STABLE FreeBSD 7.2-STABLE #2: Mon Jul 6 23:44:29 CEST 2009 root@ptavv.ka.sub.org:/usr/obj/usr/src/sys/ptavv-ng i386



>Description:
When GEOM_LABEL is configured into the kernel and e.g. a DVD with an volume
label containing an "" character is found while booting later gmirror list
or gmirror status commands return
gmirror: Cannot get GEOM tree: Unknown error: -1

GEOM_LABEL is configured into the kernel, geom_mirror loadad as a module
during boot.

Some simple tests showed, that loading geom_label as a module before or
after geom_mirror does not trigger the problem here.

>How-To-Repeat:
I found the problem mentioned on the current mailing-list at
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/current/2007-06/msg00448.html
where Kazuaki ODA shows the follwing example:
# dd if=/dev/zero of=/var/tmp/disk1.img bs=1k count=1k
# mdconfig -a -t vnode -f /var/tmp/disk1.img
md0
# glabel create <LABEL_NAME_ENCODED_OTHER_THAN_UTF8> md0
# glabel list
glabel: Cannot get GEOM tree: Unknown error: -1

>Fix:

As a work around you can avoid non-ascii characters in volume labels or
do not use geom_label at all.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 8 18:57:58 UTC 2009 
Responsible-Changed-Why:  

Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136467 

From: Ivan Voras <ivoras@freebsd.org>
To: bug-followup@freebsd.org, IZ-FreeBSD0902@hs-karlsruhe.de
Cc:  
Subject: Re: kern/136467: [geom] glabel(8) destroys access to GEOM tree if
 volume label contains non ASCII characters
Date: Thu, 09 Jul 2009 13:48:35 +0200

 Would you be happy with a sysctl knob that controls whether to interpret 
 all labels as UTF-8 or to strip out all 8-bit characters, which would by 
 default be set to "interpret as UTF-8"?

From: Ralf Wenk <IZ-FreeBSD0902-nospam@hs-karlsruhe.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/136467: [geom] glabel(8) destroys access to GEOM tree if volume label contains non ASCII characters
Date: Thu, 23 Jul 2009 10:24:44 +0200

 > Would you be happy with a sysctl knob that controls whether to interpret
 > all labels as UTF-8 or to strip out all 8-bit characters, which would by
 > default be set to "interpret as UTF-8"?
 
 Yes, that would be a nice solution.

From: Jaakko Heinonen <jh@saunalahti.fi>
To: Ivan Voras <ivoras@freebsd.org>
Cc: bug-followup@freebsd.org, IZ-FreeBSD0902@hs-karlsruhe.de
Subject: Re: kern/136467: [geom] glabel(8) destroys access to GEOM tree if
	volume label contains non ASCII characters
Date: Thu, 23 Jul 2009 14:26:16 +0300

 Hi,
 
 This PR is a duplicate of kern/104389 and kern/120044.
 
 On 2009-07-09, Ivan Voras wrote:
 >  Would you be happy with a sysctl knob that controls whether to interpret 
 >  all labels as UTF-8 or to strip out all 8-bit characters, which would by 
 >  default be set to "interpret as UTF-8"?
 
 You may already know this but it's not enough to strip 8-bit characters
 but all characters unsafe for XML output need to be handled. There are
 more details in kern/104389.
 
 -- 
 Jaakko
State-Changed-From-To: open->closed 
State-Changed-By: jilles 
State-Changed-When: Wed Aug 12 21:01:03 UTC 2009 
State-Changed-Why:  
duplicate of kern/104389 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136467 
>Unformatted:
