From owner-freebsd-current@FreeBSD.ORG Thu Jul 23 22:23:02 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A157B106566C for ; Thu, 23 Jul 2009 22:23:02 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-out1.uni-muenster.de (ZIVM-OUT1.UNI-MUENSTER.DE [128.176.192.8]) by mx1.freebsd.org (Postfix) with ESMTP id 33E798FC0C for ; Thu, 23 Jul 2009 22:23:01 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) X-IronPort-AV: E=Sophos;i="4.43,258,1246831200"; d="scan'208";a="278147988" Received: from zivmaildisp2.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.143]) by zivm-relay1.uni-muenster.de with ESMTP; 24 Jul 2009 00:23:00 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 84B911B008B; Fri, 24 Jul 2009 00:23:00 +0200 (CEST) Date: Fri, 24 Jul 2009 00:23:00 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: possible bug in sbin/fsck_msdosfs/boot.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 22:23:02 -0000 thanks a bunch. Eygene Ryabinkin schrieb am 2009-07-23: > Alexander, good day. > Thu, Jul 23, 2009 at 12:29:23PM +0200, Alexander Best wrote: > > i just tried to do fsck_msdosfs on my mobile phone's memory card > > using a usb > > connection cable. this is what `file -s` has to say about /dev/da0: > > /dev/da0: x86 boot sector, code offset 0x0, OEM-ID " ", > > sectors/cluster > > 64, reserved sectors 6304, Media descriptor 0xf8, heads 128, hidden > > sectors > > 8192, sectors 7736320 (volumes > 32 MB) , FAT (32 bit), sectors/FAT > > 944, > > reserved3 0x800000, serial number 0x34613466, label: "mem " > > however after issuing the command `fsck_msdosfs /dev/da0` i got the > > following > > error: > > fsck_msdosfs /dev/da0 > > ** /dev/da0 > > backup doesn't compare to primary bootblock > > i did a bit of research and it seems this bug was supposed to be > > fixed by > > r128463. the problem was that the entire bootblock was compared to > > the > > backupblock. but since only the first 52 bytes of the bootblock are > > important > > many device use the rest of the bootblock for some other purpose. > > the > > following change was made to sbin/fsck_msdosfs/boot.c: > > -- if (memcmp(block, backup, DOSBOOTBLOCKSIZE)) { > > ++ if (memcmp(block + 11, backup + 11, 79)) { > > it seems however that the last memcmp argument is still too high. > > could > > somebody with good fat12/16/32 knowledge please look into this? > 79 looks sane for the FAT32, see > http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html > For FAT16/FAT12 the size should be 51. Actually, what is now > compared > is the BIOS parameter block. I'll take a look at the FS forensics > book: > my memory blocks with FAT remniscents are a bit rusty ;))