netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used
@ 2022-11-17  5:33 Lai Peter Jun Ann
  2022-11-17 16:35 ` Stephen Hemminger
  2022-11-23 17:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Lai Peter Jun Ann @ 2022-11-17  5:33 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, Stephen Hemminger, Vinicius Costa Gomes,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	Muhammad Husaini Zulkifli, Lai Peter Jun Ann

This patch is to fix the issue where there is no error return
when large value of parent ID is being used. The return value by
stroul() is unsigned long int. Hence the datatype for maj and min
should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 44137ad..334334d 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -93,7 +93,7 @@ ok:
 
 int get_tc_classid(__u32 *h, const char *str)
 {
-	__u32 maj, min;
+	unsigned long maj, min;
 	char *p;
 
 	maj = TC_H_ROOT;
-- 
1.9.1


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

* Re: [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used
  2022-11-17  5:33 [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used Lai Peter Jun Ann
@ 2022-11-17 16:35 ` Stephen Hemminger
  2022-11-21  2:26   ` Lai, Peter Jun Ann
  2022-11-23 17:00 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2022-11-17 16:35 UTC (permalink / raw)
  To: Lai Peter Jun Ann
  Cc: netdev, David Ahern, Vinicius Costa Gomes, Jamal Hadi Salim,
	Cong Wang, Jiri Pirko, Muhammad Husaini Zulkifli

On Thu, 17 Nov 2022 13:33:17 +0800
Lai Peter Jun Ann <jun.ann.lai@intel.com> wrote:

> This patch is to fix the issue where there is no error return
> when large value of parent ID is being used. The return value by
> stroul() is unsigned long int. Hence the datatype for maj and min
> should defined as unsigned long to avoid overflow issue.
> 
> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
> Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>

Yes, looks good. Will apply to main.
What about qdisc_handle as well?

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

* RE: [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used
  2022-11-17 16:35 ` Stephen Hemminger
@ 2022-11-21  2:26   ` Lai, Peter Jun Ann
  0 siblings, 0 replies; 4+ messages in thread
From: Lai, Peter Jun Ann @ 2022-11-21  2:26 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, David Ahern, Gomes, Vinicius, Jamal Hadi Salim,
	Cong Wang, Jiri Pirko, Zulkifli, Muhammad Husaini

Hi,

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, November 18, 2022 12:36 AM
> To: Lai, Peter Jun Ann <peter.jun.ann.lai@intel.com>
> Cc: netdev@vger.kernel.org; David Ahern <dsahern@kernel.org>; Gomes,
> Vinicius <vinicius.gomes@intel.com>; Jamal Hadi Salim <jhs@mojatatu.com>;
> Cong Wang <xiyou.wangcong@gmail.com>; Jiri Pirko <jiri@resnulli.us>;
> Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>
> Subject: Re: [PATCH iproute2-next v1] tc_util: Fix no error return when large
> parent id used
> 
> On Thu, 17 Nov 2022 13:33:17 +0800
> Lai Peter Jun Ann <jun.ann.lai@intel.com> wrote:
> 
> > This patch is to fix the issue where there is no error return when
> > large value of parent ID is being used. The return value by
> > stroul() is unsigned long int. Hence the datatype for maj and min
> > should defined as unsigned long to avoid overflow issue.
> >
> > Signed-off-by: Muhammad Husaini Zulkifli
> > <muhammad.husaini.zulkifli@intel.com>
> > Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
> 
> Yes, looks good. Will apply to main.
> What about qdisc_handle as well?

Thanks for prompt response. 
I will submit another patch for qdisc_handle.

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

* Re: [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used
  2022-11-17  5:33 [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used Lai Peter Jun Ann
  2022-11-17 16:35 ` Stephen Hemminger
@ 2022-11-23 17:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-23 17:00 UTC (permalink / raw)
  To: Lai Peter Jun Ann
  Cc: netdev, dsahern, stephen, vinicius.gomes, jhs, xiyou.wangcong,
	jiri, muhammad.husaini.zulkifli

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Thu, 17 Nov 2022 13:33:17 +0800 you wrote:
> This patch is to fix the issue where there is no error return
> when large value of parent ID is being used. The return value by
> stroul() is unsigned long int. Hence the datatype for maj and min
> should defined as unsigned long to avoid overflow issue.
> 
> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
> Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
> 
> [...]

Here is the summary with links:
  - [iproute2-next,v1] tc_util: Fix no error return when large parent id used
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=e0ecee3a33af

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-11-23 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  5:33 [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used Lai Peter Jun Ann
2022-11-17 16:35 ` Stephen Hemminger
2022-11-21  2:26   ` Lai, Peter Jun Ann
2022-11-23 17:00 ` patchwork-bot+netdevbpf

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).