From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::241; helo=mail-io0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3BB822272963C for ; Thu, 19 Apr 2018 05:53:12 -0700 (PDT) Received: by mail-io0-x241.google.com with SMTP id h9-v6so6443848iob.5 for ; Thu, 19 Apr 2018 05:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gqyXYCjsBf6YpeJU0zRxGEPiVqQBpIcT54N0U3/wNPg=; b=H8W4ssLiSkl3WNa9od0NfQbNN+UNF6zFxy3nxgZoAsHORz+n46e+01V87cbccGskEg KJwp9ub2mn7Lno16gwtM/r/B7lronqGAi8OKGasT8QZkrpKUzrWqk9ej1Lwf595frRt7 I0XQZ+poxtFfJcQOxd5iZmf3ge1OMy52+5vpE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gqyXYCjsBf6YpeJU0zRxGEPiVqQBpIcT54N0U3/wNPg=; b=qJ5OhbCZylRMWPNU3oXmO2KzfPOr1Ft/4EqsFmcvywnoJZE/ySzCqTk/KU4CmSzgF3 epgYjzHouZetfpexJpsXGlypHGae/m92Vg6yBzDQaYpEuYLLL4VtpNY+86qo+7nbBjEF a7Ut7KPunZ+MHrRnbCd47YvFIlnYf1ZiSoC/0v9Al9Vct4BsgeLa0HYKVqfV+DwZ8j9s ldyGMPMFotdDb27j6OOtfDpTeLylUma3AozPg17LGAw8IU8nJatAP/9XUmrQMnGSrjGu BTMLSTm0lHWTN7WUz26MW5OwISI/cmRrtiIzI53//qAN2FRK4Pqw3qKaEMylVg85DumL FhUg== X-Gm-Message-State: ALQs6tBTHsD+wFQdLO3Jm4kxTT4kU+envy4W3/c9DuB3dU2q8a/tg1Yh AA24QP8MfADifG4WL9esvwc7LaZ8XOrCLgv74jloIQ== X-Google-Smtp-Source: AB8JxZrFDGl3qgi7xBfw7gWCH0nnOZUOWkrw14/VWUCcHDtbIu1KZ/IPp4KiItlba9dMifHo2elaBpM+c3O2eUn5rQc= X-Received: by 2002:a6b:ed0:: with SMTP id 199-v6mr489180ioo.170.1524142391362; Thu, 19 Apr 2018 05:53:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.67 with HTTP; Thu, 19 Apr 2018 05:53:10 -0700 (PDT) In-Reply-To: <20180419104456.3wpefk2na62cngif@bivouac.eciton.net> References: <20180412092349.8680-1-ard.biesheuvel@linaro.org> <20180419104456.3wpefk2na62cngif@bivouac.eciton.net> From: Ard Biesheuvel Date: Thu, 19 Apr 2018 14:53:10 +0200 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" , Satoru Okamoto , Graeme Gregory , Daniel Thompson , Jaswinder Singh , Masami Hiramatsu , Renato Golin , Masahisa Kojima , Bill Fletcher , linarobox Subject: Re: [PATCH edk2-platforms] Silicon/SynQuacer/NetsecDxe: fix buffer allocation bug X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 12:53:12 -0000 Content-Type: text/plain; charset="UTF-8" On 19 April 2018 at 12:44, Leif Lindholm wrote: > On Thu, Apr 12, 2018 at 11:23:49AM +0200, Ard Biesheuvel wrote: >> The receive buffers of the NETSEC driver are owned by the driver itself >> (as opposed to the protocol client in the case of the transmit path), >> and so the descriptors and the buffers (which are of a fixed size) are >> allocated in one go. The idea is that the 'buffer' member of the >> descriptor should point to a DMA aligned offset into the same allocation, >> but the code in pfdep_alloc_pkt_buf() calculates the value incorrectly, >> resulting in corruption of the descriptor metadata if the pool allocation >> happens to be DMA aligned. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ard Biesheuvel > > Reviewed-by: Leif Lindholm > Thanks Pushed as 61716249316b >> --- >> Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c >> index b43d1aaff037..0875558c08ea 100644 >> --- a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c >> +++ b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c >> @@ -134,7 +134,7 @@ pfdep_alloc_pkt_buf ( >> return PFDEP_ERR_ALLOC; >> } >> >> - (*pkt_handle_p)->Buffer = ALIGN_POINTER (*pkt_handle_p, >> + (*pkt_handle_p)->Buffer = ALIGN_POINTER (*pkt_handle_p + 1, >> mCpu->DmaBufferAlignment); >> } >> >> -- >> 2.17.0 >>