datapath: Avoid null deref when GSO is for verifying header integrity only.
authorBen Pfaff <blp@nicira.com>
Mon, 21 Jan 2013 22:29:15 +0000 (14:29 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 21 Jan 2013 22:31:41 +0000 (14:31 -0800)
commit00c7faf3e5b7d4020e995a1429cf94313f197171
tree6a742a32aff644b9dc7295f07d2248039c8fc503
parentf182253209f6972c8246335b09f5f83eba97c0c5
datapath: Avoid null deref when GSO is for verifying header integrity only.

skb_gso_segment() has the following comment:

 *    It may return NULL if the skb requires no segmentation.  This is
 *    only possible when GSO is used for verifying header integrity.

Somehow queue_gso_packets() has never hit this case before, but some
failures have suddenly been reported.  This commit should fix the problem.

Additional commentary by Jesse: We shouldn't normally be hitting this case
because we're actually trying to do GSO, not header validation.  However, I
guess the guest/backend must be generating a packet with an MSS, which
tricks us into thinking that it's GSO, but no GSO is actually requested.
In the case of the bridge, header validation does take place so the
situation is handled already.  It seems not ideal that the network backend
doesn't sanitize these packets but it's probably good that we handle
it in any case.

Bug #14772.
Reported-by: Deepesh Govindan <dgovindan@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c