VirtualBox

Changeset 56826 in vbox


Ignore:
Timestamp:
Jul 6, 2015 5:07:36 PM (9 years ago)
Author:
vboxsync
Message:

NAT: dnsproxy_answer: make sure the answer is really for our query, to
enforce socket/query correspondence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c

    r56292 r56826  
    535535    }
    536536
     537    /* find corresponding query (XXX: but see below) */
    537538    query = hash_find_request(pData, *((unsigned short *)buf));
    538539
    539     /* find corresponding query */
    540540    if (query == NULL)
    541541    {
     
    548548        return;
    549549    }
     550
     551    /*
     552     * XXX: The whole hash thing is pretty meaningless right now since
     553     * we use a separate socket for each request, so we already know
     554     * the answer.
     555     *
     556     * If the answer is not what we expect it to be, then it's
     557     * probably a stray or malicious reply and we'd better not free a
     558     * query owned by some other socket - that would cause
     559     * use-after-free later on.
     560     */
     561    if (query != so->so_timeout_arg)
     562        return;
    550563
    551564    so->so_timeout = NULL;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette