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

Submitter:  David GIRAULT <dgirault>
Submitted:  Tue 16 Jan 2018 03:43:42 PM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-f8d8.
    Corresponding source code