4 ms·
However (almost?) all syscalls dealing with filesystem paths take null-terminated strings. See for example the implementation of the open() syscall: https://gi
by reipahb 11y ago
However (almost?) all syscalls dealing with filesystem paths take null-terminated strings. See for example the implementation of the open() syscall:
https://github.com/torvalds/linux/blob/fb65d872d7a8dc629837a49513911d0281577bfd/fs/open.c#L999 https://github.com/torvalds/linux/blob/fb65d872d7a8dc629837a...
(Hence the need for the strncpy_from_user()-function: https://github.com/torvalds/linux/blob/fb65d872d7a8dc629837a49513911d0281577bfd/lib/strncpy_from_user.c#L99 https://github.com/torvalds/linux/blob/fb65d872d7a8dc629837a...)
- eddyb 11y agoAhh, I totally missed the path arguments, my bad.