All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio: fix array bounds check
@ 2017-05-12 10:18 Alejandro Lucero
  2017-05-12 11:04 ` Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Lucero @ 2017-05-12 10:18 UTC (permalink / raw)
  To: dev; +Cc: anatoly.burakov

Checking against VFIO_MAX_GROUPS goes beyond the maximum array
index which should be (VFIO_MAX_GROUPS - 1).

Fixes: 94c0776b1bad("support hotplug")
Coverity issue: 144555
Coverity issue: 144556
Coverity issue: 144557

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 5486dca..4816afc 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -189,7 +189,7 @@
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS)
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 	else
 		vfio_cfg.vfio_groups[i].devices++;
@@ -201,7 +201,7 @@
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS)
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1))
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 	else
 		vfio_cfg.vfio_groups[i].devices--;
@@ -213,7 +213,7 @@
 	int i;
 
 	i = get_vfio_group_idx(vfio_group_fd);
-	if (i < 0 || i > VFIO_MAX_GROUPS) {
+	if (i < 0 || i > (VFIO_MAX_GROUPS - 1)) {
 		RTE_LOG(ERR, EAL, "  wrong vfio_group index (%d)\n", i);
 		return -1;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfio: fix array bounds check
  2017-05-12 10:18 [PATCH] vfio: fix array bounds check Alejandro Lucero
@ 2017-05-12 11:04 ` Burakov, Anatoly
  2017-06-05 19:01   ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Burakov, Anatoly @ 2017-05-12 11:04 UTC (permalink / raw)
  To: Alejandro Lucero, dev

> From: Alejandro Lucero [mailto:alejandro.lucero@netronome.com]
> Sent: Friday, May 12, 2017 11:18 AM
> To: dev@dpdk.org
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>
> Subject: [PATCH] vfio: fix array bounds check
> 
> Checking against VFIO_MAX_GROUPS goes beyond the maximum array
> index which should be (VFIO_MAX_GROUPS - 1).
> 
> Fixes: 94c0776b1bad("support hotplug")
> Coverity issue: 144555
> Coverity issue: 144556
> Coverity issue: 144557
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>


Acked-by: Anatoly  Burakov <anatoly.burakov@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfio: fix array bounds check
  2017-05-12 11:04 ` Burakov, Anatoly
@ 2017-06-05 19:01   ` Thomas Monjalon
  2017-06-08  8:53     ` Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2017-06-05 19:01 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: dev, Burakov, Anatoly

12/05/2017 13:04, Burakov, Anatoly:
> > From: Alejandro Lucero [mailto:alejandro.lucero@netronome.com]
> > 
> > Checking against VFIO_MAX_GROUPS goes beyond the maximum array
> > index which should be (VFIO_MAX_GROUPS - 1).
> > 
> > Fixes: 94c0776b1bad("support hotplug")
> > Coverity issue: 144555
> > Coverity issue: 144556
> > Coverity issue: 144557
> > 
> > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> 
> Acked-by: Anatoly  Burakov <anatoly.burakov@intel.com>

Applied, thanks

Anatoly, you are often inserting two spaces between your first name
and last name. Recurring typo?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vfio: fix array bounds check
  2017-06-05 19:01   ` Thomas Monjalon
@ 2017-06-08  8:53     ` Burakov, Anatoly
  0 siblings, 0 replies; 4+ messages in thread
From: Burakov, Anatoly @ 2017-06-08  8:53 UTC (permalink / raw)
  To: Thomas Monjalon, Alejandro Lucero; +Cc: dev

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, June 5, 2017 8:01 PM
> To: Alejandro Lucero <alejandro.lucero@netronome.com>
> Cc: dev@dpdk.org; Burakov, Anatoly <anatoly.burakov@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] vfio: fix array bounds check
> 
> 12/05/2017 13:04, Burakov, Anatoly:
> > > From: Alejandro Lucero [mailto:alejandro.lucero@netronome.com]
> > >
> > > Checking against VFIO_MAX_GROUPS goes beyond the maximum array
> index
> > > which should be (VFIO_MAX_GROUPS - 1).
> > >
> > > Fixes: 94c0776b1bad("support hotplug") Coverity issue: 144555
> > > Coverity issue: 144556 Coverity issue: 144557
> > >
> > > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> >
> > Acked-by: Anatoly  Burakov <anatoly.burakov@intel.com>
> 
> Applied, thanks
> 
> Anatoly, you are often inserting two spaces between your first name and last
> name. Recurring typo?

Probably git misconfiguration. Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-08  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-12 10:18 [PATCH] vfio: fix array bounds check Alejandro Lucero
2017-05-12 11:04 ` Burakov, Anatoly
2017-06-05 19:01   ` Thomas Monjalon
2017-06-08  8:53     ` Burakov, Anatoly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.