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

Syscall handlers tweaks #5

Open
kristopher-pellizzi opened this issue Feb 22, 2022 · 1 comment
Open

Syscall handlers tweaks #5

kristopher-pellizzi opened this issue Feb 22, 2022 · 1 comment
Labels
enhancement New feature or request limitation Something that has drawbacks, but is necessary/desirable

Comments

@kristopher-pellizzi
Copy link
Owner

Some system call use structs as arguments.
For simplicity and speed, the corresponding syscall handlers will consider the whole struct as read.
However, those struct may have holes due to fields padding.
These paddings are not actually used by the struct, and is therefore highly probable that they are uninitialized when the system call is executed, thus causing MemTrace reporting uninitialized reads which must be considered false positives.
It is possible to slightly change syscall handlers to make them read only the used parts of the structs used as arguments.

This Issue will be used as a thread to report syscall handlers that caused some false positives during testing and possibly also the structure of the struct they use as a parameter.

@kristopher-pellizzi kristopher-pellizzi added enhancement New feature or request limitation Something that has drawbacks, but is necessary/desirable labels Feb 22, 2022
@kristopher-pellizzi
Copy link
Owner Author

ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags)

/* offset    |  size */  type = struct msghdr {
/*    0      |     8 */    void *msg_name;
/*    8      |     4 */    socklen_t msg_namelen;
/* XXX  4-byte hole  */
/*   16      |     8 */    struct iovec *msg_iov;
/*   24      |     8 */    size_t msg_iovlen;
/*   32      |     8 */    void *msg_control;
/*   40      |     8 */    size_t msg_controllen;
/*   48      |     4 */    int msg_flags;
/* XXX  4-byte padding  */

                           /* total size (bytes):   56 */
                         }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request limitation Something that has drawbacks, but is necessary/desirable
Projects
None yet
Development

No branches or pull requests

1 participant