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

Add a "conservative" build option #1

Closed
woodruffw opened this issue Jan 22, 2019 · 0 comments · Fixed by #48
Closed

Add a "conservative" build option #1

woodruffw opened this issue Jan 22, 2019 · 0 comments · Fixed by #48
Assignees
Labels
component:build Build and CI improvements component:kernel Enhancements on the kernel side enhancement New feature or request

Comments

@woodruffw
Copy link
Member

Right now, each syscall specification is defined with pretty much every possible error. This means that each syscall can fault with a wide variety of errors, but also that any given error might not make sense given the system's state and/or parameters passed to the syscall.

For example, sendto(2) specifies EAGAIN and EWOULDBLOCK as potential errors, even when the underlying socket is blocking. It's unlikely that a target application would filter error codes and notice a nonsensical ones like the above, but it wouldn't hurt to have a "conservative" build mode that only generates faulty syscalls for a sensible subset of all possible errors.

So, a spec like this:

proto: int fd, void __user *buff, size_t len, unsigned int flags, struct sockaddr __user *addr, int addr_len
parms: fd, buff, len, flags, addr, addr_len
errors:
  - EACCES
  - EAGAIN
  - EWOULDBLOCK
  - EALREADY
  - EBADF
  - ECONNRESET
  - EDESTADDRREQ
  - EFAULT
  - EINTR
  - EINVAL
  - EISCONN
  - EMSGSIZE
  - ENOBUFS
  - ENOMEM
  - ENOTCONN
  - ENOTSOCK
  - EOPNOTSUPP
  - EPIPE

would probably need to add a field like this:

basic_errors:
  - EBADF
  - ECONNRESET
  - EFAULT
# etc

To avoid duplication, we could just remove the basic_errors from the main errors list and combine the two during codegen (when not building in conservative mode).

@woodruffw woodruffw added enhancement New feature or request help wanted Extra attention is needed labels Jan 22, 2019
@woodruffw woodruffw added the good first issue Good for newcomers label Feb 25, 2019
@woodruffw woodruffw added component:build Build and CI improvements component:kernel Enhancements on the kernel side and removed good first issue Good for newcomers help wanted Extra attention is needed labels Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:build Build and CI improvements component:kernel Enhancements on the kernel side enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants