buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52902, memory leaks and more in...

 
 

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

bug #52902: memory leaks and more in altcp_tls_create_config_*

Submitter:  David GIRAULT <dgirault>
Submitted:  Mon 15 Jan 2018 04:33:03 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 08:42:21 PM UTC, comment #2: 

Pushed, thanks for the fix.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 16 Jan 2018 10:05:59 AM UTC, comment #1: 

Patch added.

David GIRAULT <dgirault>
Mon 15 Jan 2018 04:33:03 PM UTC, original submission:  


Using a static variable in altcp_tls_create_config_client() result in :

- memory leak if called multiple time (more than one HTTPS connexion at a time) because mbedtls_x509_crt_init(&acc_cert) will reset acc_cert without freeing internal allocated buffer.

- CA chain sharing for all created altcp_tls_config because mbedtls_ssl_conf_ca_chain() function does not copy the provided chain but only save a pointer to it. This result in all altcp_tls_config finally share the same CA chain, the last one loaded.

A workaround is to include acc_cert inside `struct altcp_tls_config` and call mbedtls_x509_crt_free().

The same bug exist for `altcp_tls_create_config_server_privkey_cert`.

David GIRAULT <dgirault>

 

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

Attached Files

 

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_tls_create_config.patch, #42922

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code