Re: [PATCH v2 1/6] uaccess: Add copy_from_user_nul helper

From
Steven Rostedt <rostedt@goodmis.org>
Date
2026-01-12 16:28:46
Also in
lkml
Reply to
Alice Ryhl, 2026-01-12
On Mon, 12 Jan 2026 15:40:53 +0000
Alice Ryhl [off-list ref] wrote:
I'm getting the impression that strncpy_from_user() is the real problem
here. It should append a nul byte.

That would also be a lot less error-prone than the suggested new API.
Requiring a length of N+1 is not the most immediately-obvious API.
Should we make a strscpy_from_user() API that acts the same as strscpy()
but from user space?

-- Steve
Thread (21 messages) 21 messages, 5 authors, last reply 2026-01-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help