* [Patch 1/2] MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
2017-01-03 6:12 [Patch 0/2] Fix the potential NULL pointer free Jiaxin Wu
@ 2017-01-03 6:12 ` Jiaxin Wu
2017-01-03 6:12 ` [Patch 2/2] NetworkPkg/Ip6Dxe: " Jiaxin Wu
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Wu @ 2017-01-03 6:12 UTC (permalink / raw)
To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin
Ip4Config2SetDnsServer may cause ASSERT if the invalid DNS
server address received. The issue is triggered by the NULL
pointer(Tmp) free.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 88ead9d..131b03f 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1,9 +1,9 @@
/** @file
The implementation of EFI IPv4 Configuration II Protocol.
- Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -739,17 +739,21 @@ Ip4Config2SetDnsServerWorker (
CopyMem (&DnsAddress, NewDns + NewIndex, sizeof (IP4_ADDR));
if (IP4_IS_UNSPECIFIED (NTOHL (DnsAddress)) || IP4_IS_LOCAL_BROADCAST (NTOHL (DnsAddress))) {
//
// The dns server address must be unicast.
//
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {
if (EFI_IP4_EQUAL (NewDns + NewIndex, NewDns + Index1)) {
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
}
if (OneAdded) {
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Patch 2/2] NetworkPkg/Ip6Dxe: Fix the potential NULL pointer free
2017-01-03 6:12 [Patch 0/2] Fix the potential NULL pointer free Jiaxin Wu
2017-01-03 6:12 ` [Patch 1/2] MdeModulePkg/Ip4Dxe: " Jiaxin Wu
@ 2017-01-03 6:12 ` Jiaxin Wu
2017-01-03 6:17 ` [Patch 0/2] " Fu, Siyuan
2017-01-03 6:50 ` Ye, Ting
3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Wu @ 2017-01-03 6:12 UTC (permalink / raw)
To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin
Ip6ConfigSetDnsServer may cause ASSERT if the invalid DNS
server address received. The issue is triggered by the NULL
pointer(Tmp) free.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
index 9b6a62e..4e881fd 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
@@ -1,9 +1,9 @@
/** @file
The implementation of EFI IPv6 Configuration Protocol.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
@@ -1364,17 +1364,21 @@ Ip6ConfigSetDnsServer (
if (!NetIp6IsValidUnicast (NewDns + NewIndex)) {
//
// The dns server address must be unicast.
//
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {
if (EFI_IP6_EQUAL (NewDns + NewIndex, NewDns + Index1)) {
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
}
if (OneAdded) {
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Patch 0/2] Fix the potential NULL pointer free
2017-01-03 6:12 [Patch 0/2] Fix the potential NULL pointer free Jiaxin Wu
2017-01-03 6:12 ` [Patch 1/2] MdeModulePkg/Ip4Dxe: " Jiaxin Wu
2017-01-03 6:12 ` [Patch 2/2] NetworkPkg/Ip6Dxe: " Jiaxin Wu
@ 2017-01-03 6:17 ` Fu, Siyuan
2017-01-03 6:50 ` Ye, Ting
3 siblings, 0 replies; 5+ messages in thread
From: Fu, Siyuan @ 2017-01-03 6:17 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting, Wu, Jiaxin
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: 2017年1月3日 14:13
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [Patch 0/2] Fix the potential NULL pointer free
Ip4Config2SetDnsServer/Ip6ConfigSetDnsServer may cause ASSERT if the invalid DNS server address received. The issue is triggered by the NULL pointer(Tmp) free.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Jiaxin Wu (2):
MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
NetworkPkg/Ip6Dxe: Fix the potential NULL pointer free
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 10 +++++++---
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch 0/2] Fix the potential NULL pointer free
2017-01-03 6:12 [Patch 0/2] Fix the potential NULL pointer free Jiaxin Wu
` (2 preceding siblings ...)
2017-01-03 6:17 ` [Patch 0/2] " Fu, Siyuan
@ 2017-01-03 6:50 ` Ye, Ting
3 siblings, 0 replies; 5+ messages in thread
From: Ye, Ting @ 2017-01-03 6:50 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Wu, Jiaxin
Series Reviewed-by: Ye Ting <ting.ye@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Tuesday, January 3, 2017 2:13 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [Patch 0/2] Fix the potential NULL pointer free
Ip4Config2SetDnsServer/Ip6ConfigSetDnsServer may cause ASSERT if the invalid DNS server address received. The issue is triggered by the NULL pointer(Tmp) free.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Jiaxin Wu (2):
MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
NetworkPkg/Ip6Dxe: Fix the potential NULL pointer free
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 10 +++++++---
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 5+ messages in thread