[Devel] [PATCH RHEL7 COMMIT] ploop: Sanity check that raw delta is not zero-length
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Feb 11 16:19:18 MSK 2020
The commit is pushed to "branch-rh7-3.10.0-1062.12.1.vz7.131.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.12.1.vz7.131.1
------>
commit fa496d688cc5dfd44879b5974cdabbaa699c8cb4
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue Feb 11 16:19:18 2020 +0300
ploop: Sanity check that raw delta is not zero-length
https://jira.sw.ru/browse/PSBM-100675
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/block/ploop/fmt_raw.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/ploop/fmt_raw.c b/drivers/block/ploop/fmt_raw.c
index da1f50465ff10..65e16aeaf66c4 100644
--- a/drivers/block/ploop/fmt_raw.c
+++ b/drivers/block/ploop/fmt_raw.c
@@ -56,6 +56,11 @@ raw_open(struct ploop_delta * delta)
pos += (1 << (cluster_log + 9)) - 1;
delta->io.alloc_head = pos >> (cluster_log + 9);
+ if (!delta->io.alloc_head) {
+ pr_err("ploop: zero length file\n");
+ return -EINVAL;
+ }
+
if (delta->io.ops->id == PLOOP_IO_DIRECT)
set_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
More information about the Devel
mailing list