From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.6770.1637804201220114193 for ; Wed, 24 Nov 2021 17:36:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=xn/AR/iI; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: jiaxin.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10178"; a="222291110" X-IronPort-AV: E=Sophos;i="5.87,261,1631602800"; d="scan'208,217";a="222291110" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2021 17:36:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,261,1631602800"; d="scan'208,217";a="591790933" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by FMSMGA003.fm.intel.com with ESMTP; 24 Nov 2021 17:36:40 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 24 Nov 2021 17:36:39 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 24 Nov 2021 17:36:39 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.42) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 24 Nov 2021 17:36:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MnIm9Uwn2QldT+Dk1ddXOve8TBCNBynqWXauaiQyUXwSFLGlFtokrfvuK3as7wcsoW46ze/RsGBKpJC+sXu0SvYNrJjCgr+2mkVR+zpB/CAit6fna0l5hJGrHAdogMwht5HfQk4M+A4deH7vQcqPIuSsv5mNJe6W7KH/vVXfaF1kfXgQ+eW7F6+qlJyAI/v2eYWwH5XHN+0N72sjVODV29gdQ1ULvrvka2QAsb4hAR9mm6sQHZfTz0zSfNQES9ck1S5RV6Hm1P2zfuwNcaASBMlnOnexVkYeKOuMusZoQbPQIibqh0GIw5mfUOb5SI8Up7jbBdYNZWsVkNKcKsDN6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+GoCmqUrMpkb2t3haD6CgHyVxWGeUyH9yjzUuNVR4Fs=; b=A32xoxTIZ5h60lwjyidsyITJPdFqolW/mnVmTdoPQcOYPVlwGVtvGa+ab5grwIE9OyfjoHuMXh5mTY2651usOhxI6Raw4O4JpSF4gI7ymZIw5va8Dicv2tAjNBdWm3+xVCcYYnwt4I01nh61WTEMjN8gZNFFcdVooW1O24anZLHFcQfEEtEGwLyWZm/hrKkGz4Q3NcrOXUBn6tYPCpl9KquZjBzrADHyvLNkedJvu8MFzudsyAr8rTw3tGBqTEDY+vaPLQszgKTsPTolBYY/6IJHAdgdPXfP/4I6AS1dsv7ZXIndJ4AiEXxJHxW9yfZ/cGw+mIkyPVPzO9qXtveSQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+GoCmqUrMpkb2t3haD6CgHyVxWGeUyH9yjzUuNVR4Fs=; b=xn/AR/iI5UJKdObNNi/D8qn++Z2lDa/ysWPOz3+7pkXPG1a1hCfSe4gIXjjINmpK/jGXC7bgHOXGcBR+GZAbDlB41/X58+ugDfj4VCmeOfCOs0hK7khvUle7vI+SjlwjSGNqzx+zBR5db/z5p3dLju0zIfYvGMv9wR2v7V84Qgk= Received: from DM8PR11MB5656.namprd11.prod.outlook.com (2603:10b6:8:38::7) by DM8PR11MB5573.namprd11.prod.outlook.com (2603:10b6:8:3b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Thu, 25 Nov 2021 01:36:38 +0000 Received: from DM8PR11MB5656.namprd11.prod.outlook.com ([fe80::2553:3a5d:adf8:8590]) by DM8PR11MB5656.namprd11.prod.outlook.com ([fe80::2553:3a5d:adf8:8590%6]) with mapi id 15.20.4649.015; Thu, 25 Nov 2021 01:36:38 +0000 From: "Wu, Jiaxin" To: "Anbazhagan, Baraneedharan" , "devel@edk2.groups.io" CC: "maciej.rabeda@linux.intel.com" , "Fu, Siyuan" Subject: Re: NetworkPkg: Fix invalid pointer for DNS response token on error Thread-Topic: NetworkPkg: Fix invalid pointer for DNS response token on error Thread-Index: AdfhmcEmoxR4GHdXTCeTllKNVGBF5QAAe/pgAABD/fA= Date: Thu, 25 Nov 2021 01:36:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 211e73f2-4365-4a3a-ce53-08d9afb40675 x-ms-traffictypediagnostic: DM8PR11MB5573: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2399; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VuG3kdPwIy77I5wgJ9lgGmQhcLP52I//asxruQOKYTkL6BzDYBsTJRXLG4WpHM2O4cciM9rBCQ5IDvRhY9PHq7Z0UdsKQl64Y/3JIiIBlueZvTQ/6T3MdT9G3wxu60+em1UitE7L6/45MMZDDz3g8V1Ezs+ZBSsntWoF33o1GYRw1f5u1BUWCbeId8x97m7PlNdXNKj07wHI3QmZPVSqa9Xv/FMx3A39ehg0lNd4xXaNlp1zRKoUlt8n2zSIB/lIGzhkvame4hWep/gUZKvTXGPRu3EL9Renwbl0DQ1nEWHGyeSucH9bI8eZJpkY9UQhnxgILg7E4HNgECCkDQNnc9qTsR9AwAhvwVRJzvFrJ4bD0GSo8FAEhWjvOVdbQHvxwF1qSIiNO+TUzkSvOi06ufC95gEiEhL1wCEaSxvpJJBi2g5uEKGpj6NhZtQjQMTF6nvr4q/IF1dJ9cgI9YkcEA3jqvcQ+1+gxa33ZWzPMAFhFsASmh2sGeNAUrDvN0vUcLQMe09LxKJhlVigD85jZkvjNb+/orlvftSg4UDuKSINFelSgeqMfIonSbuRIOJBEGWbMYOPIgvwOt8gV7HSztkqLfzfo+CgAg1GmNr80aFLt5LJ99mYodWGHIL+FpmM27l70LY5STh5LGJhk/DILXuiw70V73HlvfQz2voV9VtI+f5t8amKDtb8nwt8d9adKH4YQC4/llZrsWpsiDqF6lU2bXzAppldeecFr7QQkPji27wVmD3i7OYdvK8SCsOQ5oblQq0xN3GoCin074FzCIv7NY9zw4cCdy+LrjFA0kU= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR11MB5656.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(186003)(166002)(8676002)(26005)(8936002)(2906002)(38100700002)(9686003)(38070700005)(66446008)(55016003)(71200400001)(508600001)(64756008)(33656002)(110136005)(66946007)(53546011)(966005)(76116006)(4326008)(7696005)(5660300002)(316002)(52536014)(66556008)(6506007)(66476007)(122000001)(86362001)(54906003)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jdrIwvn0Aho+ts40rCeid204hSV8x2hTG6reZ7CKw1pA8VOi5j/9KaNq0Q96?= =?us-ascii?Q?rOyhGEb82piG5TS1h7Qz3kDZWuR8suz3YG2PZcZD9wku6Z5B7StjjQCaBrsn?= =?us-ascii?Q?0ag6Fbegh0mBozAYxVJrngbX5rUZeC9HtqK8gZQBJh+k6RANCSZukDcWmbZC?= =?us-ascii?Q?pPaZCHsLzqdELmH4H7jcgyAoW2BSorPPoJ4GFnkmGgvBeQZhgAvlTV4bG6XB?= =?us-ascii?Q?P6aiFilY3sMejQGi+GZ1sQgdkEFYudbB7k7t2xiyKFqFcK1L6SDV3k+b+A4O?= =?us-ascii?Q?m3Wu8kr1HAguIXzYPOxWG1liKtLsb135P29nYq3prCit99vqv0PGRUIiZq+u?= =?us-ascii?Q?jYfb4wQQL47YaZk/0ypDUtdwEpU/R7ai4XV+IToM5hwdvRn1qYu3hpFiRRe2?= =?us-ascii?Q?NYBO57F5pb9c+Bf9vl0ZSWZn34HXRc+yQjmuMOhx4KwAXqbf5rh+fuZd8M+G?= =?us-ascii?Q?1Ju7kysnXMRZmI2MJapR0aZuHaYVjA9hbLKFnzXhC4wl57LptjxzoWCtKkhU?= =?us-ascii?Q?LuCOtvYqXjymnVawXpa0YOW0VhbrCS9qmA757x6KRIqYpa0mO+vpIVcS7/ZX?= =?us-ascii?Q?JDEAvIs4K1545Yxe8SvWyEvnxX481iYcva0E7bPyEiMvdAc/TAN2i00cvQYC?= =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BIaeOBkKOhuPf3v+Zn09fLDt/F8?= =?us-ascii?Q?v1fqQWzQ0ehO3eU1wxZ1vFANTHSYoTBf0i0wF0K5YUMYP0oDvRi2cw4jbm8g?= =?us-ascii?Q?cQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5656.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 211e73f2-4365-4a3a-ce53-08d9afb40675 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2021 01:36:38.4235 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jjyEGBh91slh4aS0ZaOymfk84ahe46WV+q1JRdPmf9xWyfTXajQUhESsMSXTYp5eAw7OfbwsCfepMtAtI8Iu4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5573 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM8PR11MB5656AA9FD4CF0A27969A6464FE629DM8PR11MB5656namp_" --_000_DM8PR11MB5656AA9FD4CF0A27969A6464FE629DM8PR11MB5656namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin From: Anbazhagan, Baraneedharan Sent: Thursday, November 25, 2021 9:28 AM To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com; Wu, Jiaxin ; Fu, Si= yuan Subject: RE: NetworkPkg: Fix invalid pointer for DNS response token on erro= r Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3719 Token->RspData.H2AData is de-allocated on error but it is not set to NULL. HTTP module attempts to free again and cause assert. Signed-off-by: Baraneedharan Anbazhagan anbazhagan@hp.com --- NetworkPkg/DnsDxe/DnsImpl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c index 2edcb280ac..78a56f2b56 100644 --- a/NetworkPkg/DnsDxe/DnsImpl.c +++ b/NetworkPkg/DnsDxe/DnsImpl.c @@ -1700,6 +1700,7 @@ ON_EXIT: } FreePool (Dns4TokenEntry->Token->RspData.H2AData); + Dns4TokenEntry->Token->RspData.H2AData =3D NULL; } } } @@ -1731,6 +1732,7 @@ ON_EXIT: } FreePool (Dns6TokenEntry->Token->RspData.H2AData); + Dns6TokenEntry->Token->RspData.H2AData =3D NULL; } } } -- 2.33.0.windows.2 --_000_DM8PR11MB5656AA9FD4CF0A27969A6464FE629DM8PR11MB5656namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

 

 

 

From: Anbazhagan, Baraneedharan <anbazhaga= n@hp.com>
Sent: Thursday, November 25, 2021 9:28 AM
To: devel@edk2.groups.io
Cc: maciej.rabeda@linux.intel.com; Wu, Jiaxin <jiaxin.wu@intel.co= m>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: RE: NetworkPkg: Fix invalid pointer for DNS response token = on error

 

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3719

 

Token->RspData.H2AData is de-allocated on error b= ut it is not

set to NULL. HTTP module attempts to free again and = cause assert.

 

Signed-off-by: Baraneedharan Anbazhagan anbazhagan@hp.com

---

NetworkPkg/DnsDxe/DnsImpl.c | 2 ++

1 file changed, 2 insertions(+)

 

diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPk= g/DnsDxe/DnsImpl.c

index 2edcb280ac..78a56f2b56 100644

--- a/NetworkPkg/DnsDxe/DnsImpl.c

+++ b/NetworkPkg/DnsDxe/DnsImpl.c

@@ -1700,6 +1700,7 @@ ON_EXIT:

        &nbs= p;  }

 

        &nbs= p;  FreePool (Dns4TokenEntry->Token->RspData.H2AData);=

+        &nb= sp; Dns4TokenEntry->Token->RspData.H2AData =3D NULL;

         }

       }

     }

@@ -1731,6 +1732,7 @@ ON_EXIT:

        &nbs= p;  }

 

        &nbs= p;  FreePool (Dns6TokenEntry->Token->RspData.H2AData);=

+        &nb= sp; Dns6TokenEntry->Token->RspData.H2AData =3D NULL;

         }

       }

     }

--

2.33.0.windows.2

 

--_000_DM8PR11MB5656AA9FD4CF0A27969A6464FE629DM8PR11MB5656namp_--