Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UAF handling PGM dataloss event #4695

Open
i-garrison opened this issue Jun 12, 2024 · 0 comments
Open

UAF handling PGM dataloss event #4695

i-garrison opened this issue Jun 12, 2024 · 0 comments

Comments

@i-garrison
Copy link

If pgm_recvmsgv returns PGM_IO_STATUS_RESET, the following code stores a pointer into block which is released via pgm_free_skb() call before returning to caller:

       //  Data loss.
        if (status == PGM_IO_STATUS_RESET) {
            struct pgm_sk_buff_t *skb = pgm_msgv[0].msgv_skb[0];

            //  Save lost data TSI.
>>>         *tsi_ = &skb->tsi;
            nbytes_rec = 0;

            //  In case of dala loss -1 is returned.
            errno = EINVAL;
>>>         pgm_free_skb (skb);
            return -1;
        }

https://github.com/zeromq/libzmq/blob/master/src/pgm_socket.cpp#L576-L581

This leads to some funny behavior under load at call site where zmq::pgm_receiver_t::in_event() does peer lookup here
https://github.com/zeromq/libzmq/blob/master/src/pgm_receiver.cpp#L160-L174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant