The patch titled spi/spidev: check message size before copying has been removed from the -mm tree. Its filename was spi-spidev-check-message-size-before-copying.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: spi/spidev: check message size before copying From: Domen Puncer <domen.puncer@xxxxxxxxxxx> Message size needs to be checked before copying, or bad things could happen. Signed-off-by: Domen Puncer <domen.puncer@xxxxxxxxxxx> Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/spi/spidev.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff -puN drivers/spi/spidev.c~spi-spidev-check-message-size-before-copying drivers/spi/spidev.c --- a/drivers/spi/spidev.c~spi-spidev-check-message-size-before-copying +++ a/drivers/spi/spidev.c @@ -168,6 +168,12 @@ static int spidev_message(struct spidev_ n--, k_tmp++, u_tmp++) { k_tmp->len = u_tmp->len; + total += k_tmp->len; + if (total > bufsiz) { + status = -EMSGSIZE; + goto done; + } + if (u_tmp->rx_buf) { k_tmp->rx_buf = buf; if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len)) @@ -179,12 +185,6 @@ static int spidev_message(struct spidev_ u_tmp->len)) goto done; } - - total += k_tmp->len; - if (total > bufsiz) { - status = -EMSGSIZE; - goto done; - } buf += k_tmp->len; k_tmp->cs_change = !!u_tmp->cs_change; _ Patches currently in -mm which might be from domen.puncer@xxxxxxxxxxx are - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html