Message ID | 20221108195211.214025-2-flaniel@linux.microsoft.com |
---|---|
State | New |
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; }