Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
@ 2021-01-12  2:09 wangyingjie55
  2021-01-13  2:13 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: wangyingjie55 @ 2021-01-12  2:09 UTC (permalink / raw)
  To: kuba; +Cc: netdev, linux-kernel, Yingjie Wang

From: Yingjie Wang <wangyingjie55@126.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: 289e20bc1ab5 ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
Signed-off-by: Yingjie Wang <wangyingjie55@126.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


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

* Re: [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
  2021-01-12  2:09 [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c wangyingjie55
@ 2021-01-13  2:13 ` Jakub Kicinski
  2021-01-13 13:27   ` Yingjie Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2021-01-13  2:13 UTC (permalink / raw)
  To: wangyingjie55; +Cc: netdev, linux-kernel

On Mon, 11 Jan 2021 18:09:49 -0800 wangyingjie55@126.com wrote:
> From: Yingjie Wang <wangyingjie55@126.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: 289e20bc1ab5 ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
> Signed-off-by: Yingjie Wang <wangyingjie55@126.com>


Fixes tag: Fixes: 289e20bc1ab5 ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
Has these problem(s):
	- Target SHA1 does not exist

Where is that commit from? You're not referring to this commit itself
in your tree? The subject is suspiciously similar :S

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

* Re:Re: [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
  2021-01-13  2:13 ` Jakub Kicinski
@ 2021-01-13 13:27   ` Yingjie Wang
  2021-01-13 23:35     ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: Yingjie Wang @ 2021-01-13 13:27 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, linux-kernel

Thanks for your reply.  I commit this change on linux-next/stable branch, and I use "git log --pretty=fixes" command to get the Fixes tag. I want to know if I need to make a change on any other branch and commit it?
At 2021-01-13 10:13:28, "Jakub Kicinski" <kuba@kernel.org> wrote:
>On Mon, 11 Jan 2021 18:09:49 -0800 wangyingjie55@126.com wrote:
>> From: Yingjie Wang <wangyingjie55@126.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: 289e20bc1ab5 ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
>> Signed-off-by: Yingjie Wang <wangyingjie55@126.com>
>
>
>Fixes tag: Fixes: 289e20bc1ab5 ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
>Has these problem(s):
>	- Target SHA1 does not exist
>
>Where is that commit from? You're not referring to this commit itself
>in your tree? The subject is suspiciously similar :S

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

* Re: [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
  2021-01-13 13:27   ` Yingjie Wang
@ 2021-01-13 23:35     ` Jakub Kicinski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2021-01-13 23:35 UTC (permalink / raw)
  To: Yingjie Wang
  Cc: netdev, linux-kernel, Sunil Goutham, Jerin Jacob,
	Geetha sowjanya, Linu Cherian

On Wed, 13 Jan 2021 21:27:35 +0800 (CST) Yingjie Wang wrote:
> Thanks for your reply.  I commit this change on linux-next/stable
> branch, and I use "git log --pretty=fixes" command to get the Fixes
> tag. I want to know if I need to make a change on any other branch
> and commit it?

For networking fixes net/master would be best, but my comment
wasn't about the tree, but about which commit is quoted in the Fixes
tag.

Maybe the maintainers will help us identify the right fixes tag.
CCing them now. Please make sure to always CC maintainers
(scripts/get_maintainer.pl should help you).

Marvell folks, FWIW this is the thread in the archive for context:
https://lore.kernel.org/lkml/1610417389-9051-1-git-send-email-wangyingjie55@126.com/

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

* Re: [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
  2021-01-06  6:49 wangyingjie55
@ 2021-01-06 23:18 ` Jakub Kicinski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2021-01-06 23:18 UTC (permalink / raw)
  To: wangyingjie55; +Cc: netdev, linux-kernel

On Tue,  5 Jan 2021 22:49:17 -0800 wangyingjie55@126.com wrote:
> From: Yingjie Wang <wangyingjie55@126.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: 85482bb ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
> Signed-off-by: Yingjie Wang <wangyingjie55@126.com>

Thanks for the tag but:

Fixes tag: Fixes: 85482bb ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
Has these problem(s):
	- Target SHA1 does not exist

This hash does not seem to exist in any tree known to linux-next.

The hash should also be at least 12 chars.



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

* [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
@ 2021-01-06  6:49 wangyingjie55
  2021-01-06 23:18 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: wangyingjie55 @ 2021-01-06  6:49 UTC (permalink / raw)
  To: kuba; +Cc: netdev, linux-kernel, Yingjie Wang

From: Yingjie Wang <wangyingjie55@126.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: 85482bb ("af/rvu_cgx: Fix missing check bugs in rvu_cgx.c")
Signed-off-by: Yingjie Wang <wangyingjie55@126.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 d298b93..6c6b411 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


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

* [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c
@ 2021-01-06  4:43 wangyingjie55
  0 siblings, 0 replies; 7+ messages in thread
From: wangyingjie55 @ 2021-01-06  4:43 UTC (permalink / raw)
  To: sgoutham, lcherian, gakula, jerinj, davem, kuba
  Cc: netdev, linux-kernel, Yingjie Wang

From: Yingjie Wang <wangyingjie55@126.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.

Signed-off-by: Yingjie Wang <wangyingjie55@126.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 d298b93..6c6b411 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


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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12  2:09 [PATCH v2] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c wangyingjie55
2021-01-13  2:13 ` Jakub Kicinski
2021-01-13 13:27   ` Yingjie Wang
2021-01-13 23:35     ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2021-01-06  6:49 wangyingjie55
2021-01-06 23:18 ` Jakub Kicinski
2021-01-06  4:43 wangyingjie55

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git