[Devel] [PATCH RH8] ploop: Fix off-by-one in ploop_ctr()

Kirill Tkhai ktkhai at virtuozzo.com
Fri Apr 30 11:42:19 MSK 2021


We dereference at least two arguments: cluster_log and origin_dev.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-target.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 5ae0c624c8fb..7b5f81955abe 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -118,7 +118,7 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	struct ploop *ploop;
 	int i, ret;
 
-	if (argc < 1)
+	if (argc < 2)
 		return -EINVAL;
 
 	ploop = kzalloc(sizeof(*ploop), GFP_KERNEL);




More information about the Devel mailing list