From owner-freebsd-fs@FreeBSD.ORG Thu Apr 22 21:29:48 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF28D106566B for ; Thu, 22 Apr 2010 21:29:48 +0000 (UTC) (envelope-from scode@scode.org) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4C58FC12 for ; Thu, 22 Apr 2010 21:29:47 +0000 (UTC) Received: by wye20 with SMTP id 20so2176192wye.13 for ; Thu, 22 Apr 2010 14:29:46 -0700 (PDT) MIME-Version: 1.0 Sender: scode@scode.org Received: by 10.216.50.11 with HTTP; Thu, 22 Apr 2010 14:29:45 -0700 (PDT) X-Originating-IP: [213.114.159.69] In-Reply-To: References: Date: Thu, 22 Apr 2010 23:29:45 +0200 X-Google-Sender-Auth: 19669f67c44964ff Received: by 10.216.89.74 with SMTP id b52mr1520892wef.142.1271971785751; Thu, 22 Apr 2010 14:29:45 -0700 (PDT) Message-ID: From: Peter Schuller To: Freddie Cash Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org Subject: Re: kern.geom.debugflags=16 does NOT allow me to write to device X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2010 21:29:48 -0000 >> Somewhere in the 7.x -> 8.x transition, debugflags was incremented. =C2= =A0You > need to set it to 17 now. I saw some references to that Googling, but it doesn't work: % sysctl -w kern.geom.debugflags=3D17 prometheus:/tmp(0) kern.geom.debugflags: 17 -> 17 % ktrace disklabel -B /dev/ad9s1 prometheus:/tmp(0) disklabel: Class not found And kdump still shows: 15535 disklabel CALL open(0x800c02040,O_RDWR,0xa1a5) 15535 disklabel NAMI "/dev/ad9s1" 15535 disklabel RET open -1 errno 1 Operation not permitted In addition, geom(4) still has: 0x10 (allow foot shooting) Allow writing to Rank 1 providers. This would, for example, allow the super=E2=80=90user to overwrite the MBR on the root = disk or write random sectors elsewhere to a mounted disk. The implica= =E2=80=90 tions are obvious. In addition, geom/geom_subr.c has: /* If foot-shooting is enabled, any open on rank#1 is OK */ if ((g_debugflags & 16) && pp->geom->rank =3D=3D 1) ; I wonder if the problem is that it's not of rank 1 because I'm writing to the slice's first second rather than the MBR... That's now feeling pretty likely and can perhaps explain lots of confusion that seems to exist based on Googling. Anyone has thoughts on what the proper action here? Or do I need to patch my kernel to update my label? :) (I could pop it out of geom/zfs temporarily and hope the other disk doesn't go. But as a matter of principle I don't want to go that route...) --=20 / Peter Schuller