X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fusercopy.c;h=a3cc3052f830a01d414c7ff90c375988561863e1;hb=d060e0f603a4156087813d221d818bb39ec91429;hp=8ebae91a6b5519cebf28c623527f6429904820b1;hpb=d8298d268a172d1624ee9817e4141d86502c63d4;p=cascardo%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. */