Commit Graph
12 Commits
Author SHA1 Message Date
Rahat MahmoodandgVisor bot 8a73bd1967 Fix race on msgrcv(MSG_COPY).
Previously, we weren't making a copy when a sysv message queue was
receiving a message with the MSG_COPY flag. This flag indicates the
message being received should be left in the queue and a copy of the
message should be returned to userspace. Without the copy, a racing
process can modify the original message while it's being marshalled to
user memory.

Reported-by: [email protected]
PiperOrigin-RevId: 396712856
2021-09-14 16:53:30 -07:00
gVisor bot d3db71d3b1 Merge pull request #6262 from sudo-sturbia:msgqueue/syscalls3
PiperOrigin-RevId: 391416650
2021-08-17 17:44:26 -07:00
Zyad A. Ali 612c68bfa2 Implement control operations on msgqueue.
For IPCInfo, update value of MSGSEG constant in abi to avoid overflow in
MsgInfo.MsgSeg. MSGSEG was originaly simplified in abi, and is unused
(by us and within the kernel), so updating it is okay.

Updates #135
2021-08-17 20:31:38 +02:00
Rahat MahmoodandgVisor bot 027fe3c892 Correctly handle interruptions in blocking msgqueue syscalls.
Reported-by: [email protected]
Reported-by: [email protected]
PiperOrigin-RevId: 389084629
2021-08-05 20:16:54 -07:00
Zyad A. Ali f517422db2 Implement MSG_COPY option for msgrcv(2).
Implement Queue.Copy and add more tests for it.

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 5eb71ba8ed Implement stubs for msgsnd(2) and msgrcv(2).
Add support for msgsnd and msgrcv and enable syscall tests.

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 0a71261f8a Implement Queue.Receive.
Receive implements the behaviour of msgrcv(2) without the MSG_COPY flag.

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 377586b788 Implement Queue.Send.
Send implements the functionality of msgsnd(2).

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 0683ff858f Implement stubs for msgget(2) and msgctl(IPC_RMID).
Add support for msgget, and msgctl(IPC_RMID), and enable msgqueue
syscall tests.

Updates #135
2021-07-13 22:12:02 +02:00
Zyad A. Ali a99ab46d05 Implement Registry.Remove.
Remove implements the behaviour or msgctl(IPC_RMID).

Updates #135
2021-07-13 22:12:02 +02:00
Zyad A. Ali 83ada5e517 Implement Registry.FindOrCreate.
FindOrCreate implements the behaviour of msgget(2).

Updates #135
2021-07-13 22:12:02 +02:00
Zyad A. Ali dc420a0d2f Create package msgqueue.
Create package msgqueue, define primitives to be used for message
queues, and add a msgqueue.Registry to IPCNamespace.

Updates #135
2021-07-13 22:12:02 +02:00