mirror of
https://github.com/OpenAMP/libmetal.git
synced 2026-09-24 03:03:47 +08:00
Create an eventfd object with EFD_CLOEXEC flag
The file descriptor `irq_notify_fd` does not have the close-on-exec (`FD_CLOEXEC`) flag so it possibly leaks to child processes. This adds an `EFD_CLOEXEC` flag to the second argument of the `exentfd(2)` call, which tells it to set an `FD_CLOEXEC` flag on the new file descriptor. Signed-off-by: Kenta Sato <tosainu.maple@gmail.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
2371f615bb
commit
86fd1ba48e
@@ -219,7 +219,7 @@ int metal_linux_irq_init(void)
|
||||
|
||||
memset(&irqs, 0, sizeof(irqs));
|
||||
|
||||
irq_notify_fd = eventfd(0, 0);
|
||||
irq_notify_fd = eventfd(0, EFD_CLOEXEC);
|
||||
if (irq_notify_fd < 0) {
|
||||
metal_log(METAL_LOG_ERROR,
|
||||
"Failed to create eventfd for IRQ handling.\n");
|
||||
|
||||
Reference in New Issue
Block a user