We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c90a3bc commit d0cf385Copy full SHA for d0cf385
arch/microblaze/include/asm/uaccess.h
@@ -373,10 +373,13 @@ extern long __user_bad(void);
373
static inline long copy_from_user(void *to,
374
const void __user *from, unsigned long n)
375
{
376
+ unsigned long res = n;
377
might_fault();
- if (access_ok(VERIFY_READ, from, n))
378
- return __copy_from_user(to, from, n);
379
- return n;
+ if (likely(access_ok(VERIFY_READ, from, n)))
+ res = __copy_from_user(to, from, n);
380
+ if (unlikely(res))
381
+ memset(to + (n - res), 0, res);
382
+ return res;
383
}
384
385
#define __copy_to_user(to, from, n) \
0 commit comments