You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/net
Peter Maydell a01344d9d7 net: pad packets to minimum length in qemu_receive_packet()
In commits like 969e50b61a ("net: Pad short frames to minimum size
before sending from SLiRP/TAP") we switched away from requiring
network devices to handle short frames to instead having the net core
code do the padding of short frames out to the ETH_ZLEN minimum size.
We then dropped the code for handling short frames from the network
devices in a series of commits like 140eae9c8f ("hw/net: e1000:
Remove the logic of padding short frames in the receive path").

This missed one route where the device's receive code can still see a
short frame: if the device is in loopback mode and it transmits a
short frame via the qemu_receive_packet() function, this will be fed
back into its own receive code without being padded.

Add the padding logic to qemu_receive_packet().

This fixes a buffer overrun which can be triggered in the
e1000_receive_iov() logic via the loopback code path.

Other devices that use qemu_receive_packet() to implement loopback
are cadence_gem, dp8393x, lan9118, msf2-emac, pcnet, rtl8139
and sungem.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3043
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
3 weeks ago
..
can qom: Make InterfaceInfo[] uses const 7 months ago
af-xdp.c net/af-xdp: Support pinned map path for AF_XDP sockets 5 months ago
announce.c qapi net: Elide redundant has_FOO in generated C 3 years ago
checksum.c net: checksum: Convert data to void * 1 year ago
clients.h net: Add passt network backend 5 months ago
colo-compare.c char: rename CharBackend->CharFrontend 1 month ago
colo-compare.h Add the function of colo_compare_cleanup 5 years ago
colo-stubs.c colo: move stubs out of stubs/ 2 years ago
colo.c net/colo.c: Fix the pointer issue reported by Coverity. 3 years ago
colo.h net/colo.c: Fix the pointer issue reported by Coverity. 3 years ago
dgram.c util: drop qemu_socket_try_set_nonblock() 3 months ago
dump.c qom: Have class_init() take a const data argument 7 months ago
eth.c net/eth: Clean up local variable shadowing 2 years ago
filter-buffer.c qom: Have class_init() take a const data argument 7 months ago
filter-mirror.c char: rename CharBackend->CharFrontend 1 month ago
filter-replay.c qom: Have class_init() take a const data argument 7 months ago
filter-rewriter.c qom: Have class_init() take a const data argument 7 months ago
filter.c qom: Make InterfaceInfo[] uses const 7 months ago
hub.c net/hub: make net_hub_port_cleanup idempotent 3 weeks ago
hub.h
l2tpv3.c util: drop qemu_socket_set_nonblock() 3 months ago
meson.build net: Add passt network backend 5 months ago
net-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 10 months ago
net.c net: pad packets to minimum length in qemu_receive_packet() 3 weeks ago
netmap.c net: bundle all offloads in a single struct 2 months ago
passt.c char: rename CharBackend->CharFrontend 1 month ago
queue.c net: Remove deadcode 1 year ago
slirp.c char: rename CharBackend->CharFrontend 1 month ago
socket.c util: drop qemu_socket_try_set_nonblock() 3 months ago
stream.c net/stream: remove deprecated 'reconnect' option 1 month ago
stream_data.c util: drop qemu_socket_try_set_nonblock() 3 months ago
stream_data.h net: Refactor stream logic for reuse in '-net passt' 5 months ago
tap-bsd.c net: implement tunnel probing 2 months ago
tap-linux.c net: implement UDP tunnel features offloading 2 months ago
tap-linux.h net: implement tunnel probing 2 months ago
tap-solaris.c net: implement tunnel probing 2 months ago
tap-stub.c net: implement tunnel probing 2 months ago
tap-win32.c net: Add get_vhost_net callback to NetClientInfo 5 months ago
tap.c net: implement UDP tunnel features offloading 2 months ago
tap_int.h net: implement tunnel probing 2 months ago
trace-events vdpa: add trace event for vhost_vdpa_net_load_mq 2 years ago
trace.h
util.c
util.h Replace config-time define HOST_WORDS_BIGENDIAN 4 years ago
vde.c net: introduce qemu_set_info_str() function 3 years ago
vhost-user-stub.c net: Add save_acked_features callback to vhost_net 5 months ago
vhost-user.c char: rename CharBackend->CharFrontend 1 month ago
vhost-vdpa-stub.c vhost-net-vdpa: add stubs for when no virtio-net device is present 3 years ago
vhost-vdpa.c net/vdpa: fix potential fd leak in net_init_vhost_vdpa() 4 months ago
vmnet-bridged.m net/vmnet: Drop ifdef for macOS versions older than 12.0 1 year ago
vmnet-common.m error: Strip trailing '\n' from an error string argument 9 months ago
vmnet-host.c net/vmnet: Drop ifdef for macOS versions older than 12.0 1 year ago
vmnet-shared.c net/vmnet: Drop ifdef for macOS versions older than 12.0 1 year ago
vmnet_int.h vmnet: stop recieving events when VM is stopped 3 years ago