18 Commits
Author SHA1 Message Date
Nayana BidariandgVisor bot 1ebf17e9d9 Fix S/R support for fuse structs.
Add S/R support which was missing for a few structs in fuse, message queue and
tun packages.

PiperOrigin-RevId: 605139914
2024-02-07 17:03:14 -08:00
Andrei VaginandgVisor bot 5b33e4a3d8 Enable leak checkers for runsc tests
Updates #4572

PiperOrigin-RevId: 597307765
2024-01-10 11:30:58 -08:00
Andrei Vagin 5f4abad306 Fix a few typos
It is an idea of running codespell as part of our presubmit checks.
Before enabling it for new changes, let's fix what it has found.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2023-10-25 12:13:42 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Ayush RanjanandgVisor bot 1fa3c06f1e Delete VFS1 completely.
- Delete pkg/sentry/fs/*.
- Move pkg/sentry/fs/fsutil out of VFS1 directory and remove VFS1 components.
- Remove remaining unused references to VFS1 from remaining codebase.
- Rename/refactor code to avoid even referencing VFS2, unless necessary.
- Rewrite VFS1-only tests to VFS2.

Updates #1624

PiperOrigin-RevId: 490064269
2022-11-21 13:57:52 -08:00
Fabricio VoznikaandgVisor bot 9768009a79 Don't eat error from epoll_ctl EPOLL_CTL_ADD
Docker maps stdin to `/dev/null` which doesn't support epoll. Host FD
was ignoring the error and suceeding the epoll_ctl call from the
container, giving false impressing that epoll would be notified.

This required plumbing failure to all waiter.Waitable.EventRegister
callers and implementers.

Closes #6795

PiperOrigin-RevId: 414797621
2021-12-07 12:36:00 -08:00
Adin ScannellandgVisor bot 91f58d2cc8 Update Waitable API.
Instead of passing the event mask at registratrion time, pass the mask as part
of the waiter. This makes the mask immutable and simplifies the architecture of
waiters. This is also necessary for a future fix that will allow the fdnotifier
to keep persistent entries, as opposed to requiring constant updates.

This change is intended to be a no-op in terms of function. The only exception
is signalfd, where this mask was abused. To handle this case, the operation of
signalfd changed to allow one layer of indirection.

PiperOrigin-RevId: 409702998
2021-11-13 12:54:39 -08:00
Adin ScannellandgVisor bot 9776edb3fa Move ThreadGroupIDFromContext to kernel/auth.
This function doesn't belong in the global context package. Move to a more
suitable package to break the dependency cycle.

PiperOrigin-RevId: 406942122
2021-11-01 16:07:40 -07:00
Ayush RanjanandgVisor bot 4d07fc952d Do not leak non-permission mode bits in mq_open(2).
As caught by syzkaller, we were leaking non-permission bits while passing the
user generated mode. DynamicBytesFile panics in this case.

Reported-by: syzbot+5abe52d47d56a5a98c89@syzkaller.appspotmail.com
PiperOrigin-RevId: 405481392
2021-10-25 13:46:41 -07:00
gVisor bot 14f4113924 Merge pull request #6345 from sudo-sturbia:mq/syscalls
PiperOrigin-RevId: 404901660
2021-10-21 16:05:53 -07:00
Zyad A. Ali 9bde727f4f Implement Registry.Remove.
Remove implements the behaviour of mq_unlink(2).

Updates #136
2021-09-28 20:43:52 +02:00
Zyad A. Ali 7df562d473 Implement Registry.FindOrCreate.
FindOrCreate implements the behaviour of mq_open(2).

Updates #136
2021-09-28 20:43:52 +02:00
Zyad A. Ali 13d36561b8 Return FDs in RegistryImpl functions and use Views.
Update RegistryImpl functions to return file descriptions, instead of
queues, and use Views in queue inodes.

Updates #136
2021-09-28 20:43:52 +02:00
Zyad A. Ali 7508a0efee Define mq.View and use it for mqfs.queueFD.
View makes it easier to handle O_RDONLY, O_WRONLY, and ORDWR options in
mq_open(2).

Updates #136
2021-09-28 20:43:52 +02:00
Zyad A. Ali 229c01552e Move filesystem creation from GetFilesystem to RegistryImpl.
Move root dentry and filesystem creation from GetFilesystem to
NewRegistryImpl, create IPCNamespace.InitPosixQueues to create a new
mqueue filesystem for each ipc namespace, and update GetFilesystem to
retreive fs and root dentry from IPCNamespace and return them.

Updates #136
2021-09-28 20:43:47 +02:00
Zyad A. Ali e452ecd495 Create mq.Registry and mqfs.RegistryImpl.
Define a POSIX message queue Registry and RegistryImpl in mq package,
implement RegistryImpl in mqfs, and add a Registry object to
IPCNamespace initialized at filesystem creation.

Updates #136
2021-09-17 11:16:07 +02:00
Zyad A. Ali 0061d0e4e5 Implement queueInode and queueFD in mqfs.
Implement inode and file description representing a POSIX message queue,
and other utilities needed to implement file operations.

Updates #136
2021-09-15 21:56:35 +02:00
Zyad A. Ali 1c8a014e7e Create mq package.
Create package mq to implement POSIX message queues, and define initial
struct definitions.

Updates #136
2021-09-15 21:56:35 +02:00