VirtualBox

Changeset 41032 in vbox


Ignore:
Timestamp:
Apr 23, 2012 6:39:04 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77594
Message:

E1000: Fixed a potential read beyond TxD cache due to incorrect usage of RT_MIN (#5582)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r41030 r41032  
    32243224DECLINLINE(unsigned) e1kTxDLoadMore(E1KSTATE* pState)
    32253225{
    3226     unsigned nDescsToFetch = RT_MIN(e1kGetTxLen(pState), E1K_TXD_CACHE_SIZE - pState->nTxDFetched);
     3226    unsigned nDescsAvailable = e1kGetTxLen(pState);
     3227    unsigned nDescsToFetch = RT_MIN(nDescsAvailable, E1K_TXD_CACHE_SIZE - pState->nTxDFetched);
     3228    /*
     3229     * It is safe to use TDLEN and TDH in the following expression since TDLEN
     3230     * is set during init and never changes after that, and TDH is advanced in
     3231     * the loop we are being called from.
     3232     */
    32273233    unsigned nDescsInSingleRead = RT_MIN(nDescsToFetch, TDLEN / sizeof(E1KTXDESC) - TDH);
    32283234    if (nDescsToFetch == 0)
Note: See TracChangeset for help on using the changeset viewer.

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