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:   Sun, 28 Aug 2016 09:07:47 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Jamal Hadi Salim <jhs@...atatu.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, daniel@...earbox.net,
        xiyou.wangcong@...il.com
Subject: Re: [PATCH v3 net-next 1/1] net_sched: Introduce skbmod action

On Sun, 2016-08-28 at 08:19 -0400, Jamal Hadi Salim wrote:
> From: Jamal Hadi Salim <jhs@...atatu.com>

...

> +static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
> +			  struct tcf_result *res)
> +{
> +	struct tcf_skbmod *d = to_skbmod(a);
> +
> +	spin_lock(&d->tcf_lock);
> +	tcf_lastuse_update(&d->tcf_tm);
> +	bstats_update(&d->tcf_bstats, skb);
> +
> +	if (d->flags & SKBMOD_F_DMAC)
> +		ether_addr_copy(eth_hdr(skb)->h_dest, d->eth_dst);
> +	if (d->flags & SKBMOD_F_SMAC)
> +		ether_addr_copy(eth_hdr(skb)->h_source, d->eth_src);
> +	if (d->flags & SKBMOD_F_ETYPE)
> +		eth_hdr(skb)->h_proto = d->eth_type;
> +	if (d->flags & SKBMOD_F_SWAPMAC) {
> +		u8 tmpaddr[ETH_ALEN];
> +		/*XXX: I am sure we can come up with something more efficient */
> +		ether_addr_copy(tmpaddr, eth_hdr(skb)->h_dest);
> +		ether_addr_copy(eth_hdr(skb)->h_dest, eth_hdr(skb)->h_source);
> +		ether_addr_copy(eth_hdr(skb)->h_source, tmpaddr);
> +	}
> +
> +	spin_unlock(&d->tcf_lock);
> +	return d->tcf_action;
> +}


Adding an action with a spinlock held in fast path in 2016 is
a way to tell people : It is a toy, do not use it for real.

Sorry guys. Friends do not let friends do that anymore.

 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ