Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/xen-blkback: preq.dev is used without initialized

If call xen_vbd_translate failed, the preq.dev will be not initialized.
Use blkif->vbd.pdevice instead (still better to print relative info).

Note that before commit 01c681d4c70d64cb72142a2823f27c4146a02e63
(xen/blkback: Don't trust the handle from the frontend.)
the value bogus, as it was the guest provided value from req->u.rw.handle
rather than the actual device.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

authored by

Chen Gang and committed by
Konrad Rzeszutek Wilk
a72d9002 087ffecd

+2 -1
+2 -1
drivers/block/xen-blkback/blkback.c
··· 904 904 pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", 905 905 operation == READ ? "read" : "write", 906 906 preq.sector_number, 907 - preq.sector_number + preq.nr_sects, preq.dev); 907 + preq.sector_number + preq.nr_sects, 908 + blkif->vbd.pdevice); 908 909 goto fail_response; 909 910 } 910 911