• Florian Westphal's avatar
    net: make skb_gso_segment error handling more robust · dc12cddc
    Florian Westphal authored
    commit 330966e5 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: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    [Brad Spengler: backported to 3.2]
    Signed-off-by: default avatarBrad Spengler <spender@grsecurity.net>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    dc12cddc
xfrm_output.c 4.3 KB