Skip to content

fix: free ets->data on error paths in eaptls_receive and eaptls_free_…#597

Open
xuammu wants to merge 1 commit into
ppp-project:masterfrom
xuammu:fix-cache-not-free
Open

fix: free ets->data on error paths in eaptls_receive and eaptls_free_…#597
xuammu wants to merge 1 commit into
ppp-project:masterfrom
xuammu:fix-cache-not-free

Conversation

@xuammu

@xuammu xuammu commented Jun 16, 2026

Copy link
Copy Markdown

Summary

eaptls_receive() allocates ets->data to reassemble fragmented EAP-TLS messages, but three early-return error paths fail to free it.eaptls_free_session() also leaks ets->data when cleaning up thesession.
Each triggered error leaks up to 64KB. An attacker can repeatedly send malformed EAP-TLS packets (LI=1, MF=0, tlslen=65536, tiny payload) to exhaust memory and cause denial of service.

Affected code

pppd/eap-tls.ceaptls_receive() and eaptls_free_session()

…session

Signed-off-by: 陈玄林 <chenxuanlin@uniontech.com>
@xuammu xuammu force-pushed the fix-cache-not-free branch from 7dd6a78 to 2262acd Compare June 16, 2026 09:21
@paulusmack

Copy link
Copy Markdown
Collaborator

Thanks for this. @jjkeijser, @enaess any comments / review?

Fortunately with this kind of thing the attacker can really only deny service to themselves, since each connection has a separate pppd process.

@jjkeijser

Copy link
Copy Markdown
Contributor

The patch looks good to me. Ack

@Neustradamus

Copy link
Copy Markdown
Member

@jkroonza: Have you seen this PR?

@jkroonza jkroonza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Eyeball only.

@paulusmack yea, if they rack up enough concurrency and is quick enough about this to prevent ppp timeout they can potentially consume a reasonable amount of system RAM, but I agree, this is generally not a major issue in all likilihood (I wouldn't roll a new version just for this kind of not important).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants