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] [day] [month] [year] [list]
Date:	Tue, 5 Nov 2013 09:15:26 +0100
From:	Erik Hugne <erik.hugne@...csson.com>
To:	David Miller <davem@...emloft.net>
CC:	<netdev@...r.kernel.org>, <jon.maloy@...csson.com>,
	<maloy@...jonn.com>, <paul.gortmaker@...driver.com>,
	<ying.xue@...driver.com>
Subject: Re: [PATCH net-next v2 2/3] tipc: message reassembly using fragment
 chain

On Mon, Nov 04, 2013 at 04:12:54PM -0500, David Miller wrote:
> From: <erik.hugne@...csson.com>
> Date: Thu, 31 Oct 2013 09:40:13 +0100
> 
> > +	skb_pull(frag, msg_hdr_sz(msg));
> > +	if (fragid == FIRST_FRAGMENT) {
> > +		if (*head)
> > +			goto out_free;
> > +		*head = frag;
> > +		skb_frag_list_init(*head);
> >  		return 0;
> > +	} else {
> > +		if (!*head)
> > +			goto out_free;
> > +		if (!skb_has_frag_list(*head))
> > +			skb_shinfo(*head)->frag_list = frag;
> > +		else
> > +			(*tail)->next = frag;
> > +		*tail = frag;
> > +		(*head)->truesize += frag->truesize;
> > +	}
> > +	if (fragid == LAST_FRAGMENT) {
> > +		*fbuf = *head;
> > +		*tail = *head = NULL;
> > +		return LINK_REASM_COMPLETE;
> >  	}
> 
> Please use skb_try_coalese(), and only use frag lists if that does not
> succeed.

Will fix.

> 
> Also you must be certain to unclone the SKB if you are going to modify
> it in this kind of way.

Is it enough to just unclone the list head skb?

> 
> For a good example of how to attend to all of these things, see
> ip_frag_reasm() in net/ipv4/ip_fragment.c

Thanks David.
--
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