]> git.baikalelectronics.ru Git - kernel.git/commit
xen/netfront: don't trust the backend response data blindly
authorJuergen Gross <jgross@suse.com>
Tue, 24 Aug 2021 10:28:09 +0000 (12:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Aug 2021 09:43:21 +0000 (10:43 +0100)
commit3d468c785907759b9e5d35e3a51b2dbe6bfe9035
tree78bec8033b05c8976faf0356bd48c12c94732c8f
parentf4d826ed36d448e4dc94c52abeeac0d48fbd47e1
xen/netfront: don't trust the backend response data blindly

Today netfront will trust the backend to send only sane response data.
In order to avoid privilege escalations or crashes in case of malicious
backends verify the data to be within expected limits. Especially make
sure that the response always references an outstanding request.

Note that only the tx queue needs special id handling, as for the rx
queue the id is equal to the index in the ring page.

Introduce a new indicator for the device whether it is broken and let
the device stop working when it is set. Set this indicator in case the
backend sets any weird data.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netfront.c