Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtio/fs/linux: Fix xattrs on symlinks (leak fix) #225

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/devices/src/virtio/fs/linux/passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ impl FileSystem for PassthroughFs {
// Safe because this doesn't modify any memory and we check the return value.
unsafe {
libc::lsetxattr(
link.into_raw(),
link.as_ptr(),
name.as_ptr(),
value.as_ptr() as *const libc::c_void,
value.len(),
Expand Down Expand Up @@ -1706,7 +1706,7 @@ impl FileSystem for PassthroughFs {
// Safe because this will only modify the contents of `buf`.
unsafe {
libc::lgetxattr(
link.into_raw(),
link.as_ptr(),
name.as_ptr(),
buf.as_mut_ptr() as *mut libc::c_void,
size as libc::size_t,
Expand Down Expand Up @@ -1750,7 +1750,7 @@ impl FileSystem for PassthroughFs {
}
FileOrLink::Link(link) => unsafe {
libc::llistxattr(
link.into_raw(),
link.as_ptr(),
buf.as_mut_ptr() as *mut libc::c_char,
size as libc::size_t,
)
Expand Down Expand Up @@ -1783,7 +1783,7 @@ impl FileSystem for PassthroughFs {
}
FileOrLink::Link(link) => {
// Safe because this doesn't modify any memory and we check the return value.
unsafe { libc::lremovexattr(link.into_raw(), name.as_ptr()) }
unsafe { libc::lremovexattr(link.as_ptr(), name.as_ptr()) }
}
};

Expand Down
Loading