[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1405599324-11215-1-git-send-email-andrey.krieger.utkin@gmail.com>
Date: Thu, 17 Jul 2014 15:15:24 +0300
From: Andrey Utkin <andrey.krieger.utkin@...il.com>
To: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org
Cc: dcb314@...mail.com, davem@...emloft.net,
herbert@...dor.apana.org.au,
Andrey Utkin <andrey.krieger.utkin@...il.com>
Subject: [PATCH 3/3] drivers/crypto/omap-{des,aes}.c: fix sanity checks
Unsigned variable "total" was tested for negativity after subtraction
operation. 2 instances.
Replaced that with the test of minuend being greater than subtrahend
before the subtraction.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80421
Reported-by: David Binderman <dcb314@...mail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@...il.com>
---
drivers/crypto/omap-aes.c | 4 ++--
drivers/crypto/omap-des.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index cb98fa5..413ed78 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -1038,10 +1038,10 @@ static irqreturn_t omap_aes_irq(int irq, void *dev_id)
}
}
+ BUG_ON(dd->total < AES_BLOCK_SIZE);
+
dd->total -= AES_BLOCK_SIZE;
- BUG_ON(dd->total < 0);
-
/* Clear IRQ status */
status &= ~AES_REG_IRQ_DATA_OUT;
omap_aes_write(dd, AES_REG_IRQ_STATUS(dd), status);
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index b8bc84b..93aa213 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -965,10 +965,10 @@ static irqreturn_t omap_des_irq(int irq, void *dev_id)
}
}
+ BUG_ON(dd->total < DES_BLOCK_SIZE);
+
dd->total -= DES_BLOCK_SIZE;
- BUG_ON(dd->total < 0);
-
/* Clear IRQ status */
status &= ~DES_REG_IRQ_DATA_OUT;
omap_des_write(dd, DES_REG_IRQ_STATUS(dd), status);
--
1.8.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists