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

Commit 24a830c7 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 51740526 3b2628fa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -875,6 +875,14 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
	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;