diff options
author | Justin M. Forbes <jforbes@redhat.com> | 2013-07-23 09:07:44 -0500 |
---|---|---|
committer | Justin M. Forbes <jforbes@redhat.com> | 2013-07-23 09:07:44 -0500 |
commit | bd472195d6cd7d03e2f8692f75bb3f378ab622cc (patch) | |
tree | 7d31a2a189c604fc8017fd7d524dd66debc3d6b2 /xen-blkback-Check-device-permissions-before-allowing.patch | |
parent | faf25207dc86666a611c45ae3ffaf385c170bd2a (diff) | |
download | kernel-bd472195d6cd7d03e2f8692f75bb3f378ab622cc.tar.gz kernel-bd472195d6cd7d03e2f8692f75bb3f378ab622cc.tar.xz kernel-bd472195d6cd7d03e2f8692f75bb3f378ab622cc.zip |
Linux v3.11-rc2-93-gb3a3a9c
Diffstat (limited to 'xen-blkback-Check-device-permissions-before-allowing.patch')
-rw-r--r-- | xen-blkback-Check-device-permissions-before-allowing.patch | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/xen-blkback-Check-device-permissions-before-allowing.patch b/xen-blkback-Check-device-permissions-before-allowing.patch deleted file mode 100644 index 933e82890..000000000 --- a/xen-blkback-Check-device-permissions-before-allowing.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e029d62efa5eb46831a9e1414468e582379b743f Mon Sep 17 00:00:00 2001 -From: Konrad Rzeszutek Wilk <konrad.wilk () oracle com> -Date: Wed, 16 Jan 2013 11:33:52 -0500 -Subject: [PATCH] xen/blkback: Check device permissions before allowing - OP_DISCARD - -We need to make sure that the device is not RO or that -the request is not past the number of sectors we want to -issue the DISCARD operation for. - -Cc: stable () vger kernel org -Acked-by: Jan Beulich <JBeulich () suse com> -Acked-by: Ian Campbell <Ian.Campbell () citrix com> -[v1: Made it pr_warn instead of pr_debug] -Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk () oracle com> ---- - drivers/block/xen-blkback/blkback.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c -index e79ab45..4119bcd 100644 ---- a/drivers/block/xen-blkback/blkback.c -+++ b/drivers/block/xen-blkback/blkback.c -@@ -876,7 +876,18 @@ static int dispatch_discard_io(struct xen_blkif *blkif, - int status = BLKIF_RSP_OKAY; - struct block_device *bdev = blkif->vbd.bdev; - unsigned long secure; -+ struct phys_req preq; -+ -+ preq.sector_number = req->u.discard.sector_number; -+ preq.nr_sects = req->u.discard.nr_sectors; - -+ err = xen_vbd_translate(&preq, blkif, WRITE); -+ if (err) { -+ pr_warn(DRV_PFX "access denied: DISCARD [%llu->%llu] on dev=%04x\n", -+ preq.sector_number, -+ preq.sector_number + preq.nr_sects, blkif->vbd.pdevice); -+ goto fail_response; -+ } - blkif->st_ds_req++; - - xen_blkif_get(blkif); -@@ -887,7 +898,7 @@ static int dispatch_discard_io(struct xen_blkif *blkif, - err = blkdev_issue_discard(bdev, req->u.discard.sector_number, - req->u.discard.nr_sectors, - GFP_KERNEL, secure); -- -+fail_response: - if (err == -EOPNOTSUPP) { - pr_debug(DRV_PFX "discard op failed, not supported\n"); - status = BLKIF_RSP_EOPNOTSUPP; --- -1.8.1.4 - |