From owner-freebsd-current@FreeBSD.ORG Mon Feb 14 15:30:10 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70C29106564A; Mon, 14 Feb 2011 15:30:09 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 798018FC17; Mon, 14 Feb 2011 15:30:00 +0000 (UTC) Received: by eyf6 with SMTP id 6so2383067eyf.13 for ; Mon, 14 Feb 2011 07:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ExgQQ9zklUWcX5Nw8Bavhl4h/iCjCOYAuPb+tKHfD5E=; b=E9JGx9cJ0vAPL/tKXtPx1hH/bRAbjGSDUCqWgAYYTDkffmk5l3fPup5cUY8ynzd2nN 5VNFVmqJ3w3cyvsLb32pT2VaM0jT3LMxNrFJYkSe+Dh8KAJoFkdGHCwk86qiATyO94rx 0a9uIf5xacLM2Db1OIcs7WHr4YfvNmVYi89Z0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cvmeMzkLpP3aXt3rlJaVRbbQgjnSrGKu9KhVLOTVt41g9Mz0gD+MQ/DcDUYmIldMKo nGV4Pst1S1nmF0yKbjr8P6XyOSj8PhbspEUBj2lbLfPsDyJsE899mDNSw7GvxHyilmVT ccmsOegt7JjSBLtNA8cE6d9OW3kvwtwRyugno= MIME-Version: 1.0 Received: by 10.216.17.202 with SMTP id j52mr792643wej.36.1297697399136; Mon, 14 Feb 2011 07:29:59 -0800 (PST) Received: by 10.216.86.200 with HTTP; Mon, 14 Feb 2011 07:29:59 -0800 (PST) In-Reply-To: <201102140924.36531.jhb@freebsd.org> References: <201102140924.36531.jhb@freebsd.org> Date: Mon, 14 Feb 2011 07:29:59 -0800 Message-ID: From: Matthew Fleming To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: acpi_resource bug? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 14 Feb 2011 15:30:10 -0000 On Mon, Feb 14, 2011 at 6:24 AM, John Baldwin wrote: > On Sunday, February 13, 2011 2:46:07 pm Matthew Fleming wrote: >> I'm not very familiar with the acpi code, but we have seen an >> intermittent issue on boot: >> >> 1) should the length of the bcopy() be changed to either respect >> res->Length or the actual length of the ACPI_RESOURCE_DATA for the >> type? > > It should just use res->Length: Is there a guarantee that res->Length is <=3D sizeof(ACPI_RESOURCE) ? Thanks, matthew > > Index: acpi_resource.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- acpi_resource.c =A0 =A0 (revision 218554) > +++ acpi_resource.c =A0 =A0 (working copy) > @@ -82,7 +82,7 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void * > =A0 =A0 =A0 =A0req->found =3D 1; > =A0 =A0 =A0 =A0KASSERT(irq =3D=3D rman_get_start(req->res), > =A0 =A0 =A0 =A0 =A0 =A0("IRQ resources do not match")); > - =A0 =A0 =A0 bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE)); > + =A0 =A0 =A0 bcopy(res, req->acpi_res, res->Length); > =A0 =A0 =A0 =A0return (AE_CTRL_TERMINATE); > =A0 =A0 } > =A0 =A0 return (AE_OK); > > -- > John Baldwin >