buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52916, pbuf leaked in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52916: pbuf leaked in altcp_mbedtls_lower_recv_process

Submitted by:  David GIRAULT <dgirault>
Submitted on:  Tue 16 Jan 2018 03:43:42 PM UTC  
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 16 Jan 2018 07:56:41 PM UTC, comment #2: 

Pushed, thanks for the patch!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 16 Jan 2018 04:01:22 PM UTC, comment #1: 

Added patch that free state->rx pbuf chain inside altcp_mbedtls_close().

(file #42925)

David GIRAULT <dgirault>
Tue 16 Jan 2018 03:43:42 PM UTC, original submission:  

According to my tests, when client is configured to verify server CA chain, one pbuf is leaked when handshake is failing because of CA certificate of the server cannot be verified.

Install an invalid CA chain for the server you will connect to, set MBEDTLS_SSL_VERIFY_REQUIRED with mbedtls_ssl_conf_authmode(), then monitor statistics.

Each times connection fail, one more PBUF is loose.

state->rx may be freed by altcp_mbedtls_lower_recv_process() when handshake failed (because we may have more data queued from server) before err callback is called.

Or altcp_mbedtls_close() must ensure state->rx is NULL by cleaning the pbuf chain.

David GIRAULT <dgirault>

 

Attached Files
file #42925:  altcp_pbuf_leaked.patch added by dgirault (847B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by dgirault (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-16 goldsimon StatusNone => Fixed
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed
    2018-01-16 dgirault Attached File- => Added altcp_pbuf_leaked.patch, #42925

    Back to the top


    Powered by Savane 3.5