Skip to content

TLS socket in re-handshake state can cause large allocation in send #2859

@elcallio

Description

@elcallio

If a TLS session enters into a re-handshake (such as session key refresh) at the same time as a large buffer is being sent, gnutls will bypass the normal breaking up of sent data into block-size (16k default) buffers, and cause an allocation of a intermediate buffer of + (See gnutls_record_send2, case RECORD_SEND_KEY_UPDATE_1.

To prevent this, we need to explicitly break up sent buffers into block-size parts, ensuring the intermediate alloc remains small-is (taking large_allocation_warning_threshold into account).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions