From owner-freebsd-current@FreeBSD.ORG Mon Sep 8 07:40:21 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9827E16A4C0 for ; Mon, 8 Sep 2003 07:40:21 -0700 (PDT) Received: from sizone.org (mortar.sizone.org [65.126.154.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF51543FE1 for ; Mon, 8 Sep 2003 07:40:19 -0700 (PDT) (envelope-from dgilbert@daveg.ca) Received: by sizone.org (Postfix, from userid 66) id 3B8923005B; Mon, 8 Sep 2003 10:40:19 -0400 (EDT) Received: by canoe.dclg.ca (Postfix, from userid 101) id 794A81D1CE2; Mon, 8 Sep 2003 07:07:05 -0400 (EDT) From: David Gilbert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16220.25305.234322.831546@canoe.dclg.ca> Date: Mon, 8 Sep 2003 07:07:05 -0400 To: Soren Schmidt In-Reply-To: <200309080632.h886W4v0041506@spider.deepcore.dk> References: <16219.38485.513216.274862@canoe.dclg.ca> <200309080632.h886W4v0041506@spider.deepcore.dk> X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid cc: freebsd-current@FreeBSD.ORG cc: David Gilbert Subject: Re: patch for ATAng bug X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Mon, 08 Sep 2003 14:40:21 -0000 >>>>> "Soren" == Soren Schmidt writes: Soren> It seems David Gilbert wrote: >> I submitted kern/56572 a few minutes ago. It patches ata-disk.c to >> reject a disk that has zero blocks. >> >> This is a good thing ... malicious or broken disks (compact flash, >> whatever) shouldn't crash machines. >> >> But in this case, the detected ad3 doesn't exist. The machine is a >> laptop with a drive on channel 0 and a DVD+R on channel 1. If the >> DVD is removed, the phantom ad3 doesn't show up, either. >> >> ... so that issue with ATAng is unresolved. Soren> Uhm, I'm working on finding the real problem, and I'd like that Soren> to be the solution. However the above may be a good workaround Soren> for those bitten by this... Well... is it not possible for malicious hardware to claim to have zero blocks (by claiming one of it's parameters is zero)? Obviously it is now. Some of the other crashing complaints (complaints of crashing only without media in a zip drive, for instance) seem similar. I agree that the real problem in my instance is that the phantom drive shows up. If I can be any help on that issue, I'd be happy to boot test code. But my question is: would the same parameters passed to ad_print() result from a pathalogical device (a broken compact flash, hard disk or whathaveyou)? I put the fix in ad_attach() because I felt that some other code might break ... but shouldn't we at least protect the divide-by-zero ... or better reject devices of size zero at this point. I can't imagine that zero sizes devices are very useful for storing things. Dave. -- ============================================================================ |David Gilbert, Independent Contractor. | Two things can only be | |Mail: dave@daveg.ca | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================