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]
Message-Id: <1199385186.10508.11.camel@localhost>
Date:	Thu, 03 Jan 2008 10:33:05 -0800
From:	Joe Perches <joe@...ches.com>
To:	Paul Moore <paul.moore@...com>
Cc:	netdev@...r.kernel.org, David Miller <davem@...emloft.net>
Subject: Re: [PATCH 2/2] NET: Clone the sk_buff 'iif' field in __skb_clone()

On Thu, 2008-01-03 at 12:25 -0500, Paul Moore wrote:
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 5b4ce9b..c726cd4 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -407,31 +407,29 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
>  
>  static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
>  {
> -#define C(x) n->x = skb->x
> -
>  	n->next = n->prev = NULL;
>  	n->sk = NULL;
>  	__copy_skb_header(n, skb);
>  
> -	C(len);
> -	C(data_len);
> -	C(mac_len);
> +	n->iif = skb->iif;
> +	n->len = skb->len;
> +	n->data_len = skb->data_len;
> +	n->mac_len = skb->mac_len;
>  	n->cloned = 1;
>  	n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
>  	n->nohdr = 0;

To reduce possible cacheline bounces, shouldn't the order of
operation on the elements be in struct order?

iif should be after destructor.

nohdr then hdr_len

>  	n->destructor = NULL;
> -	C(truesize);
> +	n->truesize = skb->truesize;
>  	atomic_set(&n->users, 1);
> -	C(head);
> -	C(data);
> -	C(tail);
> -	C(end);
> +	n->head = skb->head;
> +	n->data = skb->data;
> +	n->tail = skb->tail;
> +	n->end = skb->end;

and perhaps tail,end,head,data,truesize,users?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ