X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=mm%2Fusercopy.c;h=a3cc3052f830a01d414c7ff90c375988561863e1;hb=6296c41259af263780a976d9e2db6bb581709d45;hp=8ebae91a6b5519cebf28c623527f6429904820b1;hpb=184ca823481c99dadd7d946e5afd4bb921eab30d;p=deliverable%2Flinux.git diff --git a/mm/usercopy.c b/mm/usercopy.c index 8ebae91a6b55..a3cc3052f830 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -83,7 +83,7 @@ static bool overlaps(const void *ptr, unsigned long n, unsigned long low, unsigned long check_high = check_low + n; /* Does not overlap if entirely above or entirely below. */ - if (check_low >= high || check_high < low) + if (check_low >= high || check_high <= low) return false; return true; @@ -124,7 +124,7 @@ static inline const char *check_kernel_text_object(const void *ptr, static inline const char *check_bogus_address(const void *ptr, unsigned long n) { /* Reject if object wraps past end of memory. */ - if (ptr + n < ptr) + if ((unsigned long)ptr + n < (unsigned long)ptr) return ""; /* Reject if NULL or ZERO-allocation. */