-
Notifications
You must be signed in to change notification settings - Fork 14
glibc/rawposix - writev/iovec fix #348
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain in the description and in a comment somewhere why this is needed
|
Also needs to pass linter |
| ssize_t | ||
| __writev (int fd, const struct iovec *iov, int iovcnt) | ||
| { | ||
| // clean up padding field of each iovec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
| translate_vmmap_addr(&cage, arg2).unwrap() as *const IovecStruct; | ||
| // iterate through each iovec pointer and manually do the address conversion | ||
| for i in 0..iovcnt { | ||
| let cur_iov_base = unsafe { iov_base.add(i as usize) } as *mut libc::iovec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we don't use current type casting function?
|
@ssannkkallpp these fixes should just be wrapped into the address PR |
This PR is splited from PR #164
This PR focuses on spliting out the fix for writev syscall and iovec struct
Since
iovechas addresses inside its struct, it becomes a little tricky to handle it correctly in lind. One padding fields is added below to each address field to resolve the issue of 32-bit address and 64-bit address. Therefore, the padding fields also needs to be cleaned up before sending to the rawposix