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:	Fri, 02 May 2014 20:18:13 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Zhouyi Zhou <zhouzhouyi@...il.com>, davem@...emloft.net,
	steffen.klassert@...unet.com, fan.du@...driver.com,
	dborkman@...hat.com, minipli@...glemail.com, tgraf@...g.ch,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
CC:	Zhouyi Zhou <yizhouzhou@....ac.cn>
Subject: Re: [PATCH] netdev: pktgen xmit packet through vlan interface

Hello.

On 05/02/2014 11:18 AM, Zhouyi Zhou wrote:

> As http://www.spinics.net/lists/netdev/msg165015.html
> pktgen generates shared packet through vlan interface will cause
> oops because of duplicate entering tc queue.

> Try to solve this problem by means of packet clone instead of sharing.

> Signed-off-by: Zhouyi Zhou <yizhouzhou@....ac.cn>
> ---
>   net/core/pktgen.c |   20 +++++++++++++++++---
>   1 files changed, 17 insertions(+), 3 deletions(-)

> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index 0304f98..ced07fc 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
[...]
> @@ -3347,8 +3348,18 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
>   		pkt_dev->last_ok = 0;
>   		goto unlock;
>   	}
> -	atomic_inc(&(pkt_dev->skb->users));
> -	ret = (*xmit)(pkt_dev->skb, odev);
> +
> +	if (pkt_dev->clone_skb && is_vlan_dev(odev)) {
> +		nskb = skb_clone(pkt_dev->skb, GFP_ATOMIC);
> +		ret = -ENOMEM;
> +		if (nskb)
> +			ret = (*xmit)(nskb, odev);

    You can just do:

			ret = xmit(nskb, odev);

> +		else
> +			nskb = ERR_PTR(ret);
> +	} else {
> +		atomic_inc(&(pkt_dev->skb->users));
> +		ret = (*xmit)(pkt_dev->skb, odev);

    Same here.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ