lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Jul 2020 11:37:38 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     "YU, Xiangning" <xiangning.yu@...baba-inc.com>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB)
 Qdisc

On Tue, 07 Jul 2020 02:08:13 +0800
"YU, Xiangning" <xiangning.yu@...baba-inc.com> wrote:

> +static inline int ltb_drain(struct ltb_class *cl)
> +{
> +	typeof(&cl->drain_queue) queue;
> +	struct sk_buff *skb;
> +	int npkts, bytes;
> +	unsigned long now = NOW();
> +	int cpu;
> +	struct ltb_sched *ltb = qdisc_priv(cl->root_qdisc);
> +	struct ltb_pcpu_sched *pcpu_q;
> +	s64 timestamp;
> +	bool need_watchdog = false;
> +	struct cpumask cpumask;
> +
> +	npkts = 0;
> +	bytes = 0;

It would be safer to use unsigned int for npkts and bytes.
These should never be negative.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ