Bug 386886

Summary: Bluez-Qt leaks rfkill file descriptor into all child processes of KDE session
Product: [Frameworks and Libraries] frameworks-bluez-qt Reporter: Oliver Freyermuth <o.freyermuth>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal CC: simonandric5
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Oliver Freyermuth 2017-11-13 23:12:33 UTC
All processes in my KDE session have an extra FD open pointing to 
/dev/rfkill, easily checkable with:
ls -la /proc/self/fd
lrwx------ 1 olifre olifre 64 14. Nov 00:11 0 -> /dev/pts/13
lrwx------ 1 olifre olifre 64 14. Nov 00:11 1 -> /dev/pts/13
lrwx------ 1 olifre olifre 64 14. Nov 00:11 2 -> /dev/pts/13
lr-x------ 1 olifre olifre 64 14. Nov 00:11 30 -> /dev/rfkill

Fix is simple and put up here:
https://phabricator.kde.org/D8806
Comment 1 David Rosca 2017-11-14 08:39:16 UTC
Git commit ae044d6dfec90b18c4c44cc49012fab196fa8212 by David Rosca, on behalf of Oliver Freyermuth.
Committed on 14/11/2017 at 08:38.
Pushed by drosca into branch 'master'.

Do not leak rfkill file descriptors.

Summary:
They may be leaked into all child processes,
including regular Konsole terminals on KDE.

I observed them showing up at all processes in my KDE session, just checking
ls -la /proc/self/fd

Using O_CLOEXEC, things are resolved properly.

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: drosca, bshah, broulik, #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D8806

M  +2    -2    src/rfkill.cpp

https://commits.kde.org/bluez-qt/ae044d6dfec90b18c4c44cc49012fab196fa8212