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, 06 Jun 2016 10:25:57 -0700
From:	"Samudrala, Sridhar" <sridhar.samudrala@...el.com>
To:	Jakub Kicinski <jakub.kicinski@...ronome.com>,
	netdev@...r.kernel.org
CC:	john.r.fastabend@...el.com
Subject: Re: [PATCH net 2/2] net: cls_u32: be more strict about skip-sw flag



On 6/6/2016 8:16 AM, Jakub Kicinski wrote:
> Return an error if user requested skip-sw and the underlaying
> hardware cannot handle tc offloads (or offloads are disabled).
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>

looks good. I think we need similar checks in u32_replace_hw_knode() too.


> ---
>   net/sched/cls_u32.c | 21 +++++++++++----------
>   1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
> index b17e090f2fe1..fe05449537a3 100644
> --- a/net/sched/cls_u32.c
> +++ b/net/sched/cls_u32.c
> @@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
>   	struct tc_to_netdev offload;
>   	int err;
>   
> +	if (!tc_should_offload(dev, flags))
> +		return tc_skip_sw(flags) ? -EINVAL : 0;
> +
>   	offload.type = TC_SETUP_CLSU32;
>   	offload.cls_u32 = &u32_offload;
>   
> -	if (tc_should_offload(dev, flags)) {
> -		offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
> -		offload.cls_u32->hnode.divisor = h->divisor;
> -		offload.cls_u32->hnode.handle = h->handle;
> -		offload.cls_u32->hnode.prio = h->prio;
> +	offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
> +	offload.cls_u32->hnode.divisor = h->divisor;
> +	offload.cls_u32->hnode.handle = h->handle;
> +	offload.cls_u32->hnode.prio = h->prio;
>   
> -		err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
> -						    tp->protocol, &offload);
> -		if (tc_skip_sw(flags))
> -			return err;
> -	}
> +	err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
> +					    tp->protocol, &offload);
> +	if (tc_skip_sw(flags))
> +		return err;
>   
>   	return 0;
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ