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: <20131104.161254.1576011108092991976.davem@davemloft.net>
Date:	Mon, 04 Nov 2013 16:12:54 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	erik.hugne@...csson.com
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

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.

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

For a good example of how to attend to all of these things, see
ip_frag_reasm() in net/ipv4/ip_fragment.c
--
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