diff options
-rw-r--r-- | mm/nommu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 298884dcd6e7..1898b2fe9da5 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -282,6 +282,10 @@ EXPORT_SYMBOL(vmalloc_to_pfn); | |||
282 | 282 | ||
283 | long vread(char *buf, char *addr, unsigned long count) | 283 | long vread(char *buf, char *addr, unsigned long count) |
284 | { | 284 | { |
285 | /* Don't allow overflow */ | ||
286 | if ((unsigned long) buf + count < count) | ||
287 | count = -(unsigned long) buf; | ||
288 | |||
285 | memcpy(buf, addr, count); | 289 | memcpy(buf, addr, count); |
286 | return count; | 290 | return count; |
287 | } | 291 | } |