Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2003 11:00:39 -0400
From:      Tom Rhodes <trhodes@FreeBSD.org>
To:        Stefan Esser <se@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/pci pci_user.c
Message-ID:  <20031013110039.658d22f1.trhodes@FreeBSD.org>
In-Reply-To: <200310112220.h9BMKZqA046052@repoman.freebsd.org>
References:  <200310112220.h9BMKZqA046052@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 11 Oct 2003 15:20:35 -0700 (PDT)
Stefan Esser <se@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031013110039.658d22f1.trhodes>