Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c128d06e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: card: block: check the user controlled parameters to avoid overflow"

parents b4cb77bd 4fc34e42
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -636,6 +636,14 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
	cmd.arg = idata->ic.arg;
	cmd.flags = idata->ic.flags;

	if (idata->ic.postsleep_max_us < idata->ic.postsleep_min_us) {
		pr_err("%s: min value: %u must not be greater than max value: %u\n",
			__func__, idata->ic.postsleep_min_us,
			idata->ic.postsleep_max_us);
		WARN_ON(1);
		return -EPERM;
	}

	if (idata->buf_bytes) {
		data.sg = &sg;
		data.sg_len = 1;