Message ID | 20221110085614.111213-2-albancrequy@linux.microsoft.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8678ea06852cd1f819b870c773d43df888d15d46 |
Headers | show |
Series | Fix offset when fault occurs in strncpy_from_kernel_nofault() | expand |
diff --git a/mm/maccess.c b/mm/maccess.c index 5f4d240f67ec..074f6b086671 100644 --- a/mm/maccess.c +++ b/mm/maccess.c @@ -97,7 +97,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count) return src - unsafe_addr; Efault: pagefault_enable(); - dst[-1] = '\0'; + dst[0] = '\0'; return -EFAULT; }