aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2014-10-20 13:49:17 +0200
committerBen Hutchings <ben@decadent.org.uk>2015-05-09 23:16:40 +0100
commitdc12cddcebe3ba42e9d8c56b4605c440f3e4122f (patch)
tree53da9beca26947b494b97d20ade1a17f19c2669d /net/xfrm/xfrm_output.c
parent82241580d7734af2207ad0bb1720904f569dac3a (diff)
downloadkernel_samsung_smdk4412-dc12cddcebe3ba42e9d8c56b4605c440f3e4122f.zip
kernel_samsung_smdk4412-dc12cddcebe3ba42e9d8c56b4605c440f3e4122f.tar.gz
kernel_samsung_smdk4412-dc12cddcebe3ba42e9d8c56b4605c440f3e4122f.tar.bz2
net: make skb_gso_segment error handling more robust
commit 330966e501ffe282d7184fde4518d5e0c24bc7f8 upstream. skb_gso_segment has three possible return values: 1. a pointer to the first segmented skb 2. an errno value (IS_ERR()) 3. NULL. This can happen when GSO is used for header verification. However, several callers currently test IS_ERR instead of IS_ERR_OR_NULL and would oops when NULL is returned. Note that these call sites should never actually see such a NULL return value; all callers mask out the GSO bits in the feature argument. However, there have been issues with some protocol handlers erronously not respecting the specified feature mask in some cases. It is preferable to get 'have to turn off hw offloading, else slow' reports rather than 'kernel crashes'. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net> [Brad Spengler: backported to 3.2] Signed-off-by: Brad Spengler <spender@grsecurity.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 47bacd8..e49d5f4 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -151,6 +151,8 @@ static int xfrm_output_gso(struct sk_buff *skb)
kfree_skb(skb);
if (IS_ERR(segs))
return PTR_ERR(segs);
+ if (segs == NULL)
+ return -EINVAL;
do {
struct sk_buff *nskb = segs->next;