net: mipsnet: check transmit buffer size before sending
When processing MIPSnet I/O port write operation, it uses a transmit buffer tx_buffer[MAX_ETH_FRAME_SIZE=1514]. Two indices 's->tx_written' and 's->tx_count' are used to control data written to this buffer. If the two were to be equal before writing, it'd lead to an OOB write access beyond tx_buffer. Add check to avoid it. Reported-by:Li Qiang <qiang6-s@360.cn> Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by:
Jason Wang <jasowang@redhat.com>
Please register or sign in to comment