Skip to content

Commit 1d0827a

Browse files
committed
Fix readlinkat syscalls to not be readonly.
The `readlinkat` syscall writes into the output buffer, so it is not `readonly`, so use a non-`readonly` syscall wrapper for it. I believe this bug isn't observable outside the crate, due to the restricted ways that the actual syscall wrapper is used.
1 parent f3f061a commit 1d0827a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/imp/linux_raw/fs/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ pub(crate) fn statfs(filename: &ZStr) -> io::Result<StatFs> {
617617
pub(crate) fn readlink(path: &ZStr, buf: &mut [u8]) -> io::Result<usize> {
618618
let (buf_addr_mut, buf_len) = slice_mut(buf);
619619
unsafe {
620-
ret_usize(syscall4_readonly(
620+
ret_usize(syscall4(
621621
nr(__NR_readlinkat),
622622
c_int(AT_FDCWD),
623623
c_str(path),
@@ -631,7 +631,7 @@ pub(crate) fn readlink(path: &ZStr, buf: &mut [u8]) -> io::Result<usize> {
631631
pub(crate) fn readlinkat(dirfd: BorrowedFd<'_>, path: &ZStr, buf: &mut [u8]) -> io::Result<usize> {
632632
let (buf_addr_mut, buf_len) = slice_mut(buf);
633633
unsafe {
634-
ret_usize(syscall4_readonly(
634+
ret_usize(syscall4(
635635
nr(__NR_readlinkat),
636636
borrowed_fd(dirfd),
637637
c_str(path),

0 commit comments

Comments
 (0)