mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
The problem is that we were putting the NUL terminator too far: buf[sizeof(buf) - 1] = '\0'; If the user input isn't NUL terminated and they haven't initialized the whole buffer then it leads to an info leak. The NUL terminator should be: buf[len - 1] = '\0'; Signed-off-by: Yihui Zeng <[email protected]> Cc: [email protected] Signed-off-by: Dan Carpenter <[email protected]> [[email protected]: keep semantics of how *lenp and *ppos are handled] Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>