From owner-cvs-all@FreeBSD.ORG Sat Oct 11 15:20:35 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF1F816A4B3; Sat, 11 Oct 2003 15:20:35 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55CB143F93; Sat, 11 Oct 2003 15:20:35 -0700 (PDT) (envelope-from se@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h9BMKZXJ046053; Sat, 11 Oct 2003 15:20:35 -0700 (PDT) (envelope-from se@repoman.freebsd.org) Received: (from se@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h9BMKZqA046052; Sat, 11 Oct 2003 15:20:35 -0700 (PDT) (envelope-from se) Message-Id: <200310112220.h9BMKZqA046052@repoman.freebsd.org> From: Stefan Esser Date: Sat, 11 Oct 2003 15:20:35 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/pci pci_user.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2003 22:20:35 -0000 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) Revision Changes Path 1.14 +24 -46 src/sys/dev/pci/pci_user.c