mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
v4l2: don't expose the internal fd
When allocating memory, just export the mmaped memory and mark the memory as MemPtr, not MemFd. Set the fd to -1. Otherwise we might send this fd to the client, making the complete device accessible to the client.
This commit is contained in:
parent
ec331f4e4c
commit
941620b733
1 changed files with 2 additions and 2 deletions
|
|
@ -1488,9 +1488,9 @@ mmap_init(struct impl *this,
|
|||
use_expbuf = true;
|
||||
} else {
|
||||
fallback:
|
||||
d[0].type = SPA_DATA_MemFd;
|
||||
d[0].type = SPA_DATA_MemPtr;
|
||||
d[0].flags = SPA_DATA_FLAG_READABLE;
|
||||
d[0].fd = dev->fd;
|
||||
d[0].fd = -1;
|
||||
d[0].mapoffset = b->v4l2_buffer.m.offset;
|
||||
d[0].data = mmap(NULL,
|
||||
b->v4l2_buffer.length,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue