public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup
@ 2020-09-05  1:15 D Scott Phillips
  2020-09-07 11:33 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 4+ messages in thread
From: D Scott Phillips @ 2020-09-05  1:15 UTC (permalink / raw)
  To: devel

From: D Scott Phillips <d.scott.phillips@amperecomputing.com>

Leaving TlsChildHandle with the stale handle causes later use of https
with the http instance to incorrectly skip tls reconfiguration, use
the stale handle, and eventually call a garbage function pointer.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1917
Signed-off-by: D Scott Phillips <d.scott.phillips@amperecomputing.com>
---
 NetworkPkg/HttpDxe/HttpProto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 3c7c6ff9f0..afc7db5a72 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -873,6 +873,7 @@ HttpCleanProtocol (
     // Destroy the TLS instance.
     //
     HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
+    HttpInstance->TlsChildHandle = NULL;
   }
 
   if (HttpInstance->Tcp4ChildHandle != NULL) {
-- 
2.26.2



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

* Re: [edk2-devel] [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup
  2020-09-05  1:15 [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup D Scott Phillips
@ 2020-09-07 11:33 ` Laszlo Ersek
  2020-09-08  4:50   ` D Scott Phillips
  0 siblings, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2020-09-07 11:33 UTC (permalink / raw)
  To: devel, scott; +Cc: Rebecca Cran

Hi Scott,

(+Rebecca)

On 09/05/20 03:15, D Scott Phillips wrote:
> From: D Scott Phillips <d.scott.phillips@amperecomputing.com>
> 
> Leaving TlsChildHandle with the stale handle causes later use of https
> with the http instance to incorrectly skip tls reconfiguration, use
> the stale handle, and eventually call a garbage function pointer.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1917
> Signed-off-by: D Scott Phillips <d.scott.phillips@amperecomputing.com>
> ---
>  NetworkPkg/HttpDxe/HttpProto.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
> index 3c7c6ff9f0..afc7db5a72 100644
> --- a/NetworkPkg/HttpDxe/HttpProto.c
> +++ b/NetworkPkg/HttpDxe/HttpProto.c
> @@ -873,6 +873,7 @@ HttpCleanProtocol (
>      // Destroy the TLS instance.
>      //
>      HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
> +    HttpInstance->TlsChildHandle = NULL;
>    }
>  
>    if (HttpInstance->Tcp4ChildHandle != NULL) {
> 

thanks a lot for tracking this down!

I've reopened BZ#1917, and linked your patch email in a new comment.

But, I'd also like to assign the BZ to you, if that's OK with you. Can
you please register in the TianoCore bugzilla instance for that?

Thanks!
Laszlo


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

* Re: [edk2-devel] [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup
  2020-09-07 11:33 ` [edk2-devel] " Laszlo Ersek
@ 2020-09-08  4:50   ` D Scott Phillips
  2020-09-15 13:01     ` Maciej Rabeda
  0 siblings, 1 reply; 4+ messages in thread
From: D Scott Phillips @ 2020-09-08  4:50 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: devel@edk2.groups.io, Rebecca Cran

On Monday, September 7, 2020 4:33 AM, Laszlo Ersek <lersek@redhat.com> wrote:

> Hi Scott,
>
> (+Rebecca)
>
> On 09/05/20 03:15, D Scott Phillips wrote:
>
> > From: D Scott Phillips d.scott.phillips@amperecomputing.com
> > Leaving TlsChildHandle with the stale handle causes later use of https
> > with the http instance to incorrectly skip tls reconfiguration, use
> > the stale handle, and eventually call a garbage function pointer.
> >
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1917
> > Signed-off-by: D Scott Phillips d.scott.phillips@amperecomputing.com
> >
> > ------------------------------------------------------------------------------------------------------------------------------
> >
> > NetworkPkg/HttpDxe/HttpProto.c | 1 +
> > 1 file changed, 1 insertion(+)
> > diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
> > index 3c7c6ff9f0..afc7db5a72 100644
> > --- a/NetworkPkg/HttpDxe/HttpProto.c
> > +++ b/NetworkPkg/HttpDxe/HttpProto.c
> > @@ -873,6 +873,7 @@ HttpCleanProtocol (
> > // Destroy the TLS instance.
> > //
> > HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
> >
> > -   HttpInstance->TlsChildHandle = NULL;
> >     }
> >
> >
> > if (HttpInstance->Tcp4ChildHandle != NULL) {
>
> thanks a lot for tracking this down!
>
> I've reopened BZ#1917, and linked your patch email in a new comment.
>
> But, I'd also like to assign the BZ to you, if that's OK with you. Can
> you please register in the TianoCore bugzilla instance for that?

Certainly, account created and assignment taken. Thanks Laszlo.

Scott


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

* Re: [edk2-devel] [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup
  2020-09-08  4:50   ` D Scott Phillips
@ 2020-09-15 13:01     ` Maciej Rabeda
  0 siblings, 0 replies; 4+ messages in thread
From: Maciej Rabeda @ 2020-09-15 13:01 UTC (permalink / raw)
  To: devel, scott, Laszlo Ersek; +Cc: Rebecca Cran

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

Hi Scott,

Thanks for submitting the patch - I am about to approve the patch, 
however - a couple of small remarks to the commit message.
1. Please remove the "From:" line
2. Please add "Cc:" lines before "Signed-off-by". Cc people are added 
based on appropriate EDK2 package maintainer & reviewer list: 
https://github.com/tianocore/edk2/blob/master/Maintainers.txt
Example of a patch from NetworkPkg: 
https://github.com/tianocore/edk2/commit/0716b2390f005e84961cb98af28bd16cdcc5db42

Thanks,
Maciej

On 08-Sep-20 06:50, D Scott Phillips wrote:
> On Monday, September 7, 2020 4:33 AM, Laszlo Ersek <lersek@redhat.com> wrote:
>
>> Hi Scott,
>>
>> (+Rebecca)
>>
>> On 09/05/20 03:15, D Scott Phillips wrote:
>>
>>> *From: D Scott Phillips d.scott.phillips@amperecomputing.com*
>>> Leaving TlsChildHandle with the stale handle causes later use of https
>>> with the http instance to incorrectly skip tls reconfiguration, use
>>> the stale handle, and eventually call a garbage function pointer.
>>>
>>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1917
>>> Signed-off-by: D Scott Phillips d.scott.phillips@amperecomputing.com
>>>
>>> ------------------------------------------------------------------------------------------------------------------------------
>>>
>>> NetworkPkg/HttpDxe/HttpProto.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>> diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
>>> index 3c7c6ff9f0..afc7db5a72 100644
>>> --- a/NetworkPkg/HttpDxe/HttpProto.c
>>> +++ b/NetworkPkg/HttpDxe/HttpProto.c
>>> @@ -873,6 +873,7 @@ HttpCleanProtocol (
>>> // Destroy the TLS instance.
>>> //
>>> HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
>>>
>>> -   HttpInstance->TlsChildHandle = NULL;
>>>      }
>>>
>>>
>>> if (HttpInstance->Tcp4ChildHandle != NULL) {
>> thanks a lot for tracking this down!
>>
>> I've reopened BZ#1917, and linked your patch email in a new comment.
>>
>> But, I'd also like to assign the BZ to you, if that's OK with you. Can
>> you please register in the TianoCore bugzilla instance for that?
> Certainly, account created and assignment taken. Thanks Laszlo.
>
> Scott
>
>
> 
>


[-- Attachment #2: Type: text/html, Size: 3494 bytes --]

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

end of thread, other threads:[~2020-09-15 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-05  1:15 [PATCH] NetworkPkg/HttpDxe: Clear TlsChildHandle during cleanup D Scott Phillips
2020-09-07 11:33 ` [edk2-devel] " Laszlo Ersek
2020-09-08  4:50   ` D Scott Phillips
2020-09-15 13:01     ` Maciej Rabeda

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