Skip to content
Commit d2b0f96f authored by Vladislav Yasevich's avatar Vladislav Yasevich Committed by Michael Roth
Browse files

rtl8139: Fix receive buffer overflow check



rtl8139_do_receive() tries to check for the overflow condition
by making sure that packet_size + 8 does not exceed the
available buffer space.  The issue here is that RxBuffAddr,
used to calculate available buffer space, is aligned to a
a 4 byte boundry after every update.  So it is possible that
every packet ends up being slightly padded when written
to the receive buffer.  This padding is not taken into
account when checking for overflow and we may end up missing
the overflow condition can causing buffer overwrite.

This patch takes alignment into consideration when
checking for overflow condition.

Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
Reviewed-by: default avatarJason Wang <jasowang@redhat.com>
Message-id: 1441121206-6997-2-git-send-email-vyasevic@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit fabdcd33)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent a0043185
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment