mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
Tools: hv: kvp: ensure kvp device fd is closed on exec
KVP daemon does fork()/exec() (with popen()) so we need to close our fds to avoid sharing them with child processes. The immediate implication of not doing so I see is SELinux complaining about 'ip' trying to access '/dev/vmbus/hv_kvp'. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3724287c0e
commit
26840437cb
@ -1433,7 +1433,7 @@ int main(int argc, char *argv[])
|
||||
openlog("KVP", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "KVP starting; pid is:%d", getpid());
|
||||
|
||||
kvp_fd = open("/dev/vmbus/hv_kvp", O_RDWR);
|
||||
kvp_fd = open("/dev/vmbus/hv_kvp", O_RDWR | O_CLOEXEC);
|
||||
|
||||
if (kvp_fd < 0) {
|
||||
syslog(LOG_ERR, "open /dev/vmbus/hv_kvp failed; error: %d %s",
|
||||
|
Loading…
Reference in New Issue
Block a user