mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
st/xa: replace call to dup(2) with fcntl(F_DUPFD_CLOEXEC)
Without this fix, duplicated file descriptors leak into child processes.
See commit aaac913e90 for one instance
where the same fix was employed.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Matt Whitlock <freedesktop@mattwhitlock.name>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
0c060f691c
commit
ac6064f918
1 changed files with 2 additions and 1 deletions
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include "xa_tracker.h"
|
||||
#include "xa_priv.h"
|
||||
#include "pipe/p_state.h"
|
||||
|
|
@ -157,7 +158,7 @@ xa_tracker_create(int drm_fd)
|
|||
if (!xa)
|
||||
return NULL;
|
||||
|
||||
if (drm_fd < 0 || (fd = dup(drm_fd)) < 0)
|
||||
if (drm_fd < 0 || (fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 3)) < 0)
|
||||
goto out_no_fd;
|
||||
|
||||
if (pipe_loader_drm_probe_fd(&xa->dev, fd))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue