linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mvpp2: cls: Check RSS table index validity when creating a context
@ 2019-05-27 11:52 Maxime Chevallier
  2019-05-28 18:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Chevallier @ 2019-05-27 11:52 UTC (permalink / raw)
  To: davem
  Cc: Dan Carpenter, kbuild test robot, Antoine Tenart, netdev,
	gregory.clement, linux-kernel, Maxime Chevallier, nadavh,
	linux-arm-kernel, thomas.petazzoni, miquel.raynal, stefanc, mw,
	Russell King

Make sure we don't use an out-of-bound index for the per-port RSS
context array.

As of today, the global context creation in mvpp22_rss_context_create
will prevent us from reaching this case, but we should still make sure
we are using a sane value anyway.

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index cd0daad011ce..bd19a910dc90 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -1466,6 +1466,9 @@ int mvpp22_port_rss_ctx_create(struct mvpp2_port *port, u32 *port_ctx)
 			break;
 	}
 
+	if (i == MVPP22_N_RSS_TABLES)
+		return -EINVAL;
+
 	port->rss_ctx[i] = rss_ctx;
 	*port_ctx = i;
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next] net: mvpp2: cls: Check RSS table index validity when creating a context
  2019-05-27 11:52 [PATCH net-next] net: mvpp2: cls: Check RSS table index validity when creating a context Maxime Chevallier
@ 2019-05-28 18:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-05-28 18:20 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: lkp, antoine.tenart, netdev, gregory.clement, linux-kernel,
	linux, nadavh, dan.carpenter, thomas.petazzoni, miquel.raynal,
	stefanc, mw, linux-arm-kernel

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Mon, 27 May 2019 13:52:01 +0200

> Make sure we don't use an out-of-bound index for the per-port RSS
> context array.
> 
> As of today, the global context creation in mvpp22_rss_context_create
> will prevent us from reaching this case, but we should still make sure
> we are using a sane value anyway.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Applied.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-05-28 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 11:52 [PATCH net-next] net: mvpp2: cls: Check RSS table index validity when creating a context Maxime Chevallier
2019-05-28 18:20 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).