From owner-svn-src-all@FreeBSD.ORG Mon Feb 14 18:51:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 33535106564A; Mon, 14 Feb 2011 18:51:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Mon, 14 Feb 2011 13:50:48 -0500 User-Agent: KMail/1.6.2 References: <201102141720.p1EHKKeU000451@svn.freebsd.org> <201102141333.05054.jhb@freebsd.org> In-Reply-To: <201102141333.05054.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102141350.55218.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218685 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 18:51:09 -0000 On Monday 14 February 2011 01:33 pm, John Baldwin wrote: > On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote: > > Author: mdf > > Date: Mon Feb 14 17:20:20 2011 > > New Revision: 218685 > > URL: http://svn.freebsd.org/changeset/base/218685 > > > > Log: > > Prevent reading from the ACPI_RESOURCE past its actual end. > > For paranoia limit to the size of the ACPI_RESOURCE as well. > > I think in practice that len would never be > > sizeof(ACPI_RESOURCE). > > You could probably get by with using a KASSERT() instead: > > KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too > large")); bcopy(res, req->acpi_res, res->Length); We should avoid sizeof(ACPI_RESOURCE). If you really have to know size of a specific resource type, there is a convenience macro, i.e., ACPI_RS_SIZE(type). Jung-uk Kim