提交 8ebe2607 编写于 作者: P Pali Rohár 提交者: Ulf Hansson

mmc: sdio: Check for CISTPL_VERS_1 buffer size

Before parsing CISTPL_VERS_1 structure check that its size is at least two
bytes to prevent buffer overflow.
Signed-off-by: NPali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20200727133837.19086-2-pali@kernel.orgSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 0ac4f496
......@@ -26,6 +26,9 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
unsigned i, nr_strings;
char **buffer, *string;
if (size < 2)
return 0;
/* Find all null-terminated (including zero length) strings in
the TPLLV1_INFO field. Trailing garbage is ignored. */
buf += 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册