From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: Laszlo Ersek <lersek@redhat.com>, "Ni, Ray" <ray.ni@intel.com>,
"Wu, Jiaxin" <jiaxin.wu@intel.com>,
"Fu, Siyuan" <siyuan.fu@intel.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"maciej.rabeda@linux.intel.com" <maciej.rabeda@linux.intel.com>
Subject: Re: [edk2-devel] [PATCH v1] ShellPkg: Fix 'ping' command Ip4 receive flow.
Date: Thu, 26 Mar 2020 03:16:05 +0000 [thread overview]
Message-ID: <526dba76ac004389873ca89c053407af@intel.com> (raw)
In-Reply-To: <e319a343-543d-74c4-2eaf-a10590b72bf4@redhat.com>
The ping command implementation would go into the ip4/ip6 protocol. But I am not familiar with the network part.
Jiaxin/Siyuan,
Can you help to review this patch?
Thanks,
Zhichao
> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Wednesday, March 25, 2020 7:34 PM
> To: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Cc: devel@edk2.groups.io; maciej.rabeda@linux.intel.com
> Subject: Re: [edk2-devel] [PATCH v1] ShellPkg: Fix 'ping' command Ip4
> receive flow.
>
> Ray, Zhichao,
>
> On 02/27/20 12:02, Maciej Rabeda wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2032
> >
> > 'ping' command's receive flow utilizes a single Rx token which it
> > attempts to reuse before recycling the previously received packet.
> > This causes a situation where under ICMP traffic,
> > Ping6OnEchoReplyReceived() function will receive an already recycled
> > packet with EFI_SUCCESS token status and finally dereference invalid
> > pointers from RxData structure.
> >
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Zhichao Gao <zhichao.gao@intel.com>
> > Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> > ---
> > ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
>
> can you please review this ShellPkg patch? It's been on the list for almost a
> month now.
>
> Thanks
> Laszlo
>
> > diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> > b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> > index 23567fa2c1bb..a3fa32515192 100644
> > --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> > +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> > @@ -614,6 +614,11 @@ Ping6OnEchoReplyReceived (
> >
> > ON_EXIT:
> >
> > + //
> > + // Recycle the packet before reusing RxToken // gBS->SignalEvent
> > + (Private->IpChoice ==
> > + PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private-
> >RxToken.Packet.R
> > + xData)->RecycleSignal:((EFI_IP4_RECEIVE_DATA*)Private-
> >RxToken.Packe
> > + t.RxData)->RecycleSignal);
> > +
> > if (Private->RxCount < Private->SendNum) {
> > //
> > // Continue to receive icmp echo reply packets.
> > @@ -632,10 +637,6 @@ ON_EXIT:
> > //
> > Private->Status = EFI_SUCCESS;
> > }
> > - //
> > - // Singal to recycle the each rxdata here, not at the end of process.
> > - //
> > - gBS->SignalEvent (Private->IpChoice ==
> > PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private-
> >RxToken.Packet.RxD
> > ata)->RecycleSignal:((EFI_IP4_RECEIVE_DATA*)Private-
> >RxToken.Packet.Rx
> > Data)->RecycleSignal);
> > }
> >
> > /**
> >
next prev parent reply other threads:[~2020-03-26 3:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 11:02 [PATCH v1] ShellPkg: Fix 'ping' command Ip4 receive flow Maciej Rabeda
2020-02-27 13:14 ` [edk2-devel] " Laszlo Ersek
2020-02-27 17:40 ` Laszlo Ersek
2020-02-28 2:59 ` Liming Gao
2020-02-28 11:41 ` Maciej Rabeda
2020-02-28 11:50 ` Liming Gao
2020-02-28 12:35 ` Maciej Rabeda
2020-03-02 13:43 ` Liming Gao
2020-03-25 11:34 ` Laszlo Ersek
2020-03-26 3:16 ` Gao, Zhichao [this message]
2020-03-31 9:03 ` Maciej Rabeda
2020-03-31 11:53 ` Siyuan, Fu
2020-03-31 14:50 ` Gao, Zhichao
2020-03-31 17:42 ` Maciej Rabeda
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=526dba76ac004389873ca89c053407af@intel.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