summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-05-27 12:34:35 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-31 20:52:59 +0200
commitf2633d2eaaab773ea8b29cea3785cf0f8a8872a5 (patch)
tree7e7a7e03f72c394181ba4feb1ad4752fc78ecef9 /drivers/atm
parentatm: firestream: add more reserved strings (diff)
downloadlinux-f2633d2eaaab773ea8b29cea3785cf0f8a8872a5.tar.xz
linux-f2633d2eaaab773ea8b29cea3785cf0f8a8872a5.zip
atm: iphase: off by one in rx_pkt()
The iadev->rx_open[] array holds "iadev->num_vc" pointers (this code assumes that pointers are 32 bits). So the > here should be >= or else we could end up reading a garbage pointer from one element beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/iphase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 7d00f2994738..809dd1e02091 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1128,7 +1128,7 @@ static int rx_pkt(struct atm_dev *dev)
/* make the ptr point to the corresponding buffer desc entry */
buf_desc_ptr += desc;
if (!desc || (desc > iadev->num_rx_desc) ||
- ((buf_desc_ptr->vc_index & 0xffff) > iadev->num_vc)) {
+ ((buf_desc_ptr->vc_index & 0xffff) >= iadev->num_vc)) {
free_desc(dev, desc);
IF_ERR(printk("IA: bad descriptor desc = %d \n", desc);)
return -1;