Skip to content
Commit 0102eeed authored by Andrea Parri (Microsoft)'s avatar Andrea Parri (Microsoft) Committed by Jakub Kicinski
Browse files

hv_netvsc: Allocate the recv_buf buffers after NVSP_MSG1_TYPE_SEND_RECV_BUF



The recv_buf buffers are allocated in netvsc_device_add().  Later in
netvsc_init_buf() the response to NVSP_MSG1_TYPE_SEND_RECV_BUF allows
the host to set up a recv_section_size that could be bigger than the
(default) value used for that allocation.  The host-controlled value
could be used by a malicious host to bypass the check on the packet's
length in netvsc_receive() and hence to overflow the recv_buf buffer.

Move the allocation of the recv_buf buffers into netvsc_init_but().

Reported-by: default avatarJuan Vazquez <juvazq@microsoft.com>
Signed-off-by: default avatarAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Fixes: 0ba35fe9 ("hv_netvsc: Copy packets sent by Hyper-V out of the receive buffer")
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6b4950d9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment