Patch "mmc: sdio: Check for CISTPL_VERS_1 buffer size" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mmc: sdio: Check for CISTPL_VERS_1 buffer size

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mmc-sdio-check-for-cistpl_vers_1-buffer-size.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bb860952def0e697f1c0a15635de536a45e5cc60
Author: Pali Rohár <pali@xxxxxxxxxx>
Date:   Mon Jul 27 15:38:34 2020 +0200

    mmc: sdio: Check for CISTPL_VERS_1 buffer size
    
    [ Upstream commit 8ebe2607965d3e2dc02029e8c7dd35fbe508ffd0 ]
    
    Before parsing CISTPL_VERS_1 structure check that its size is at least two
    bytes to prevent buffer overflow.
    
    Signed-off-by: Pali Rohár <pali@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200727133837.19086-2-pali@xxxxxxxxxx
    Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
index 8e94e555b788d..8651bd30863d4 100644
--- a/drivers/mmc/core/sdio_cis.c
+++ b/drivers/mmc/core/sdio_cis.c
@@ -30,6 +30,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;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux