Skip to content

Possible use-after-free in RFReaderInfoById #140

@emaxx-google

Description

@emaxx-google

After a reader disappears, RFReaderInfoById() (for example, called from SCardDisconnect()) might try dereferencing an READER_CONTEXT::handlesList value that's already destroyed by the hotplug thread in removeReader().

UAF place:

currentHandle = list_seek(&sReadersContexts[i]->handlesList,

Deallocation place:

list_destroy(&sContext->handlesList);

P.S. It should supposedly be a very rare corner case, since normally readers aren't plugged and unplugged very often, and the overlap with another SCard operation on another thread should have right timing in order to trigger the issue.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions