public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Satoru Okamoto <okamoto.satoru@socionext.com>,
	 Graeme Gregory <graeme.gregory@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	 Jaswinder Singh <jaswinder.singh@linaro.org>,
	Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	 Renato Golin <renato.golin@linaro.org>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	 Bill Fletcher <bill.fletcher@linaro.org>,
	linarobox <linarobox@linaro.org>
Subject: Re: [PATCH edk2-platforms] Silicon/SynQuacer/NetsecDxe: fix buffer allocation bug
Date: Thu, 19 Apr 2018 14:53:10 +0200	[thread overview]
Message-ID: <CAKv+Gu9kJQzLcPK4nDBvvtP-q5H3xn4qC0mQBhN06iRaHN4zTA@mail.gmail.com> (raw)
In-Reply-To: <20180419104456.3wpefk2na62cngif@bivouac.eciton.net>

On 19 April 2018 at 12:44, Leif Lindholm <leif.lindholm@linaro.org> 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 <ard.biesheuvel@linaro.org>
>
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>

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
>>


      reply	other threads:[~2018-04-19 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  9:23 [PATCH edk2-platforms] Silicon/SynQuacer/NetsecDxe: fix buffer allocation bug Ard Biesheuvel
2018-04-19 10:44 ` Leif Lindholm
2018-04-19 12:53   ` Ard Biesheuvel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu9kJQzLcPK4nDBvvtP-q5H3xn4qC0mQBhN06iRaHN4zTA@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox