Commit:     78608ba0326f1448f9a10dbb402a38192559f639
Parent:     39aaac114e192bce500204f9c9e1fffff4c2b519
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Sat Nov 10 21:53:30 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sat Nov 10 21:53:30 2007 -0800

    [NET]: Fix skb_truesize_check() assertion
    The intent of the assertion in skb_truesize_check() is to check
    for skb->truesize being decremented too much by other code,
    resulting in a wraparound below zero.
    The type of the right side of the comparison causes the compiler to
    promote the left side to an unsigned type, despite the presence of an
    explicit type cast.  This defeats the check for negativity.
    Ensure both sides of the comparison are a signed type to prevent the
    implicit type conversion.
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 include/linux/skbuff.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 94e4991..91140fe 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -387,7 +387,9 @@ extern void       skb_truesize_bug(struct sk_buff *skb);
 static inline void skb_truesize_check(struct sk_buff *skb)
-       if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len))
+       int len = sizeof(struct sk_buff) + skb->len;
+       if (unlikely((int)skb->truesize < len))
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to