]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xen-netback: fix input validation in xenvif_set_hash_mapping()
authorJan Beulich <JBeulich@suse.com>
Fri, 19 Oct 2018 09:46:04 +0000 (11:46 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Tue, 23 Oct 2018 06:45:58 +0000 (08:45 +0200)
commit3e349aa121c81ba985153714926d8cc83c2504e0
tree824a6c6ef2c93e22ac52ec8a4e2530348f043c18
parent00ab3ffb35c4472bc415dc90fc3a646c2b40630d
xen-netback: fix input validation in xenvif_set_hash_mapping()

Both len and off are frontend specified values, so we need to make
sure there's no overflow when adding the two for the bounds check. We
also want to avoid undefined behavior and hence use off to index into
->hash.mapping[] only after bounds checking. This at the same time
allows to take care of not applying off twice for the bounds checking
against vif->num_queues.

It is also insufficient to bounds check copy_op.len, as this is len
truncated to 16 bits.

This is XSA-270 / CVE-2018-15471.

Reported-by: Felix Wilhelm <fwilhelm@google.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Tested-by: Paul Durrant <paul.durrant@citrix.com>
Cc: stable@vger.kernel.org [4.7 onwards]
Signed-off-by: David S. Miller <davem@davemloft.net>
CVE-2018-15471
(cherry picked from commit 780e83c259fc33e8959fed8dfdad17e378d72b62)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/xen-netback/hash.c