[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR18MB26023B6D29E67754CDF8FB2FCDA71@DM6PR18MB2602.namprd18.prod.outlook.com>
Date: Fri, 15 Jan 2021 10:58:49 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: "wangyingjie55@....com" <wangyingjie55@....com>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"Vidhya Vidhyaraman" <vraman@...vell.com>,
"Stanislaw Kardach [C]" <skardach@...vell.com>
CC: Sunil Kovvuri Goutham <sgoutham@...vell.com>,
Linu Cherian <lcherian@...vell.com>,
Jerin Jacob Kollanukkaran <jerinj@...vell.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [EXT] [PATCH v3] octeontx2-af: Fix missing check bugs in
rvu_cgx.c
The changes look good to me.
You can add:
Reviewed-by: Geetha sowjanya<gakula@...vell.com>
________________________________________
From: wangyingjie55@....com <wangyingjie55@....com>
Sent: Thursday, January 14, 2021 11:00 AM
To: davem@...emloft.net; kuba@...nel.org; Vidhya Vidhyaraman; Stanislaw Kardach [C]
Cc: Sunil Kovvuri Goutham; Linu Cherian; Geethasowjanya Akula; Jerin Jacob Kollanukkaran; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Yingjie Wang
Subject: [EXT] [PATCH v3] octeontx2-af: Fix missing check bugs in rvu_cgx.c
External Email
----------------------------------------------------------------------
From: Yingjie Wang <wangyingjie55@....com>
In rvu_mbox_handler_cgx_mac_addr_get()
and rvu_mbox_handler_cgx_mac_addr_set(),
the msg is expected only from PFs that are mapped to CGX LMACs.
It should be checked before mapping,
so we add the is_cgx_config_permitted() in the functions.
Fixes: 96be2e0da85e ("octeontx2-af: Support for MAC address filters in CGX")
Signed-off-by: Yingjie Wang <wangyingjie55@....com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index d298b9357177..6c6b411e78fd 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -469,6 +469,9 @@ int rvu_mbox_handler_cgx_mac_addr_set(struct rvu *rvu,
int pf = rvu_get_pf(req->hdr.pcifunc);
u8 cgx_id, lmac_id;
+ if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
+ return -EPERM;
+
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
cgx_lmac_addr_set(cgx_id, lmac_id, req->mac_addr);
@@ -485,6 +488,9 @@ int rvu_mbox_handler_cgx_mac_addr_get(struct rvu *rvu,
int rc = 0, i;
u64 cfg;
+ if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
+ return -EPERM;
+
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
rsp->hdr.rc = rc;
--
2.7.4
Powered by blists - more mailing lists