https://github.com/torvalds/linux
Revision f291196979ca80cdef199ca2b55e2758e8c23a0d authored by Herbert Xu ~{PmVHI~} on 05 June 2006, 22:03:37 UTC, committed by David S. Miller on 05 June 2006, 22:03:37 UTC
Trimming the head of an skb by calling skb_pull can cause the packet
to become unaligned if the length pulled is odd.  Since the length is
entirely arbitrary for a FIN packet carrying data, this is actually
quite common.

Unaligned data is not the end of the world, but we should avoid it if
it's easily done.  In this case it is trivial.  Since we're discarding
all of the head data it doesn't matter whether we move skb->data forward
or back.

However, it is still possible to have unaligned skb->data in general.
So network drivers should be prepared to handle it instead of crashing.

This patch also adds an unlikely marking on len < headlen since partial
ACKs on head data are extremely rare in the wild.  As the return value
of __pskb_trim_head is no longer ever NULL that has been removed.

Signed-off-by: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 364212e
History
Tip revision: f291196979ca80cdef199ca2b55e2758e8c23a0d authored by Herbert Xu ~{PmVHI~} on 05 June 2006, 22:03:37 UTC
[TCP]: Avoid skb_pull if possible when trimming head
Tip revision: f291196
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
scripts
security
sound
usr
.gitignore -rw-r--r-- 462 bytes
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 87.4 KB
Kbuild -rw-r--r-- 1.2 KB
MAINTAINERS -rw-r--r-- 68.8 KB
Makefile -rw-r--r-- 43.6 KB
README -rw-r--r-- 16.2 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top