From owner-cvs-src@FreeBSD.ORG Mon Oct 13 08:01:10 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0EBB16A4B3; Mon, 13 Oct 2003 08:01:10 -0700 (PDT) Received: from pittgoth.com (14.zlnp1.xdsl.nauticom.net [209.195.149.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57EF243FB1; Mon, 13 Oct 2003 08:01:07 -0700 (PDT) (envelope-from trhodes@FreeBSD.org) Received: from localhost (acs-24-154-239-120.zoominternet.net [24.154.239.120]) by pittgoth.com (8.12.9/8.12.9) with SMTP id h9DF15vd030543; Mon, 13 Oct 2003 11:01:05 -0400 (EDT) (envelope-from trhodes@FreeBSD.org) Date: Mon, 13 Oct 2003 11:00:39 -0400 From: Tom Rhodes To: Stefan Esser Message-Id: <20031013110039.658d22f1.trhodes@FreeBSD.org> In-Reply-To: <200310112220.h9BMKZqA046052@repoman.freebsd.org> References: <200310112220.h9BMKZqA046052@repoman.freebsd.org> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/pci pci_user.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2003 15:01:10 -0000 On Sat, 11 Oct 2003 15:20:35 -0700 (PDT) Stefan Esser wrote: > se 2003/10/11 15:20:35 PDT > > FreeBSD src repository > > Modified files: > sys/dev/pci pci_user.c > Log: > The code that was meant to test alignment of the register offset > parameter in the read and write case dereferenced an unitialized > pointer and can't possibly ever have catched an actual invalid > argument. > > This was apparently true for the read/write and getconf cases. The > latter does not even receive the paramter that is to be verified. > > I'm surprised that this did not cause kernel panics, but it seems > that the uninitialized local variable happens to contain data that > may be used as a pointer to memory that satisfies the test condition. > > Make the code work as intended by moving the test inside the switch > case where the pointer has been properly initialized. > > Since the read and write case shared just about all code (except > for the single call to PCIB_READ_CONFIG resp. PCIB_WRITE_CONFIG) I > have merged both cases. > > Noticed by: trhodes@FreeBSD.org (Tom Rhodes) Thank you!! -- Tom Rhodes