public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
       [not found] <cover.1581551021.git.nicholas.armour@intel.com>
@ 2020-02-12 23:53 ` Armour, Nicholas
  2020-02-17  5:07   ` [edk2-devel] " Liming Gao
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Armour, Nicholas @ 2020-02-12 23:53 UTC (permalink / raw)
  To: devel; +Cc: Nicholas Armour, Jiaxin Wu, Maciej Rabeda, Siyuan Fu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2031

This patch triggers the RecycleEvent for invalid ARP packets.
Prior to this, we would just ignore invalid ARP packets,
and never free them.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Nicholas Armour <nicholas.armour@intel.com>
---
 NetworkPkg/ArpDxe/ArpImpl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/ArpDxe/ArpImpl.c b/NetworkPkg/ArpDxe/ArpImpl.c
index 9cdb33f2bd66..09fc8811f125 100644
--- a/NetworkPkg/ArpDxe/ArpImpl.c
+++ b/NetworkPkg/ArpDxe/ArpImpl.c
@@ -125,6 +125,7 @@ ArpOnFrameRcvdDpc (
   Head->OpCode    = NTOHS (Head->OpCode);
 
   if (RxData->DataLength < (sizeof (ARP_HEAD) + 2 * Head->HwAddrLen + 2 * Head->ProtoAddrLen)) {
+    gBS->SignalEvent (RxData->RecycleEvent);
     goto RESTART_RECEIVE;
   }
 
-- 
2.16.2.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
  2020-02-12 23:53 ` [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559) Armour, Nicholas
@ 2020-02-17  5:07   ` Liming Gao
  2020-02-17  5:15   ` Siyuan, Fu
  2020-02-17  7:50   ` [edk2-devel] " Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2020-02-17  5:07 UTC (permalink / raw)
  To: devel@edk2.groups.io, Armour, Nicholas
  Cc: Wu, Jiaxin, Maciej Rabeda, Fu, Siyuan, Laszlo Ersek

Jiaxin, Maciej and Siyuan:
  I suggest to catch this CVE fix for edk2 Q1 stable tag. Can you help review this patch soon? 

Thanks
Liming
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Armour, Nicholas
> Sent: Thursday, February 13, 2020 7:54 AM
> To: devel@edk2.groups.io
> Cc: Armour, Nicholas <nicholas.armour@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Maciej Rabeda
> <maciej.rabeda@linux.intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
> Subject: [edk2-devel] [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2031
> 
> This patch triggers the RecycleEvent for invalid ARP packets.
> Prior to this, we would just ignore invalid ARP packets,
> and never free them.
> 
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Signed-off-by: Nicholas Armour <nicholas.armour@intel.com>
> ---
>  NetworkPkg/ArpDxe/ArpImpl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/ArpDxe/ArpImpl.c b/NetworkPkg/ArpDxe/ArpImpl.c
> index 9cdb33f2bd66..09fc8811f125 100644
> --- a/NetworkPkg/ArpDxe/ArpImpl.c
> +++ b/NetworkPkg/ArpDxe/ArpImpl.c
> @@ -125,6 +125,7 @@ ArpOnFrameRcvdDpc (
>    Head->OpCode    = NTOHS (Head->OpCode);
> 
>    if (RxData->DataLength < (sizeof (ARP_HEAD) + 2 * Head->HwAddrLen + 2 * Head->ProtoAddrLen)) {
> +    gBS->SignalEvent (RxData->RecycleEvent);
>      goto RESTART_RECEIVE;
>    }
> 
> --
> 2.16.2.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
  2020-02-12 23:53 ` [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559) Armour, Nicholas
  2020-02-17  5:07   ` [edk2-devel] " Liming Gao
@ 2020-02-17  5:15   ` Siyuan, Fu
  2020-02-17 15:44     ` Maciej Rabeda
  2020-02-17  7:50   ` [edk2-devel] " Laszlo Ersek
  2 siblings, 1 reply; 5+ messages in thread
From: Siyuan, Fu @ 2020-02-17  5:15 UTC (permalink / raw)
  To: Armour, Nicholas, devel@edk2.groups.io; +Cc: Wu, Jiaxin, Maciej Rabeda

Hi, Nicholas

Should the signal recycle event also be added to below if condition?

  if (RxData->DataLength < sizeof (ARP_HEAD)) {
    //
    // Restart the receiving if packet size is not correct.
    //
    goto RESTART_RECEIVE;
  }


Best Regards
Siyuan 

> -----Original Message-----
> From: Armour, Nicholas <nicholas.armour@intel.com>
> Sent: 2020年2月13日 7:54
> To: devel@edk2.groups.io
> Cc: Armour, Nicholas <nicholas.armour@intel.com>; Wu, Jiaxin
> <jiaxin.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Fu,
> Siyuan <siyuan.fu@intel.com>
> Subject: [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-
> 2019-14559).
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2031
> 
> This patch triggers the RecycleEvent for invalid ARP packets.
> Prior to this, we would just ignore invalid ARP packets,
> and never free them.
> 
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Signed-off-by: Nicholas Armour <nicholas.armour@intel.com>
> ---
>  NetworkPkg/ArpDxe/ArpImpl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/ArpDxe/ArpImpl.c b/NetworkPkg/ArpDxe/ArpImpl.c
> index 9cdb33f2bd66..09fc8811f125 100644
> --- a/NetworkPkg/ArpDxe/ArpImpl.c
> +++ b/NetworkPkg/ArpDxe/ArpImpl.c
> @@ -125,6 +125,7 @@ ArpOnFrameRcvdDpc (
>    Head->OpCode    = NTOHS (Head->OpCode);
> 
>    if (RxData->DataLength < (sizeof (ARP_HEAD) + 2 * Head->HwAddrLen + 2 *
> Head->ProtoAddrLen)) {
> +    gBS->SignalEvent (RxData->RecycleEvent);
>      goto RESTART_RECEIVE;
>    }
> 
> --
> 2.16.2.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
  2020-02-12 23:53 ` [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559) Armour, Nicholas
  2020-02-17  5:07   ` [edk2-devel] " Liming Gao
  2020-02-17  5:15   ` Siyuan, Fu
@ 2020-02-17  7:50   ` Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-02-17  7:50 UTC (permalink / raw)
  To: devel, nicholas.armour; +Cc: Jiaxin Wu, Maciej Rabeda, Siyuan Fu

On 02/13/20 00:53, Armour, Nicholas wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2031
> 
> This patch triggers the RecycleEvent for invalid ARP packets.
> Prior to this, we would just ignore invalid ARP packets,
> and never free them.
> 
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Signed-off-by: Nicholas Armour <nicholas.armour@intel.com>
> ---
>  NetworkPkg/ArpDxe/ArpImpl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/ArpDxe/ArpImpl.c b/NetworkPkg/ArpDxe/ArpImpl.c
> index 9cdb33f2bd66..09fc8811f125 100644
> --- a/NetworkPkg/ArpDxe/ArpImpl.c
> +++ b/NetworkPkg/ArpDxe/ArpImpl.c
> @@ -125,6 +125,7 @@ ArpOnFrameRcvdDpc (
>    Head->OpCode    = NTOHS (Head->OpCode);
>  
>    if (RxData->DataLength < (sizeof (ARP_HEAD) + 2 * Head->HwAddrLen + 2 * Head->ProtoAddrLen)) {
> +    gBS->SignalEvent (RxData->RecycleEvent);
>      goto RESTART_RECEIVE;
>    }
>  
> 

Please put a space character in the subject line, before the
"(CVE-2019-14559)" part.

Please also drop the trailing dot.

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559).
  2020-02-17  5:15   ` Siyuan, Fu
@ 2020-02-17 15:44     ` Maciej Rabeda
  0 siblings, 0 replies; 5+ messages in thread
From: Maciej Rabeda @ 2020-02-17 15:44 UTC (permalink / raw)
  To: Fu, Siyuan, Armour, Nicholas, devel@edk2.groups.io; +Cc: Wu, Jiaxin

Hi Nicholas,

Instead of adding gBS->SignalEvent() lines, please utilize 
RECYCLE_RXDATA goto label. You can find the same gBS->SignalEvent() 
being done there.
Additionally, please apply goto change in place pointed by Siyuan.

Thanks,
Maciej

On 17-Feb-20 06:15, Fu, Siyuan wrote:
> Hi, Nicholas
>
> Should the signal recycle event also be added to below if condition?
>
>    if (RxData->DataLength < sizeof (ARP_HEAD)) {
>      //
>      // Restart the receiving if packet size is not correct.
>      //
>      goto RESTART_RECEIVE;
>    }
>
>
> Best Regards
> Siyuan
>
>> -----Original Message-----
>> From: Armour, Nicholas <nicholas.armour@intel.com>
>> Sent: 2020年2月13日 7:54
>> To: devel@edk2.groups.io
>> Cc: Armour, Nicholas <nicholas.armour@intel.com>; Wu, Jiaxin
>> <jiaxin.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Fu,
>> Siyuan <siyuan.fu@intel.com>
>> Subject: [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-
>> 2019-14559).
>>
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2031
>>
>> This patch triggers the RecycleEvent for invalid ARP packets.
>> Prior to this, we would just ignore invalid ARP packets,
>> and never free them.
>>
>> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
>> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
>> Cc: Siyuan Fu <siyuan.fu@intel.com>
>> Signed-off-by: Nicholas Armour <nicholas.armour@intel.com>
>> ---
>>   NetworkPkg/ArpDxe/ArpImpl.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/NetworkPkg/ArpDxe/ArpImpl.c b/NetworkPkg/ArpDxe/ArpImpl.c
>> index 9cdb33f2bd66..09fc8811f125 100644
>> --- a/NetworkPkg/ArpDxe/ArpImpl.c
>> +++ b/NetworkPkg/ArpDxe/ArpImpl.c
>> @@ -125,6 +125,7 @@ ArpOnFrameRcvdDpc (
>>     Head->OpCode    = NTOHS (Head->OpCode);
>>
>>     if (RxData->DataLength < (sizeof (ARP_HEAD) + 2 * Head->HwAddrLen + 2 *
>> Head->ProtoAddrLen)) {
>> +    gBS->SignalEvent (RxData->RecycleEvent);
>>       goto RESTART_RECEIVE;
>>     }
>>
>> --
>> 2.16.2.windows.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-17 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1581551021.git.nicholas.armour@intel.com>
2020-02-12 23:53 ` [PATCH 1/1] NetworkPkg/ArpDxe: Recycle invalid ARP packets(CVE-2019-14559) Armour, Nicholas
2020-02-17  5:07   ` [edk2-devel] " Liming Gao
2020-02-17  5:15   ` Siyuan, Fu
2020-02-17 15:44     ` Maciej Rabeda
2020-02-17  7:50   ` [edk2-devel] " Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox