Red Hat Bugzilla – Bug 834338
SECURITY: kgrantpty: unnecessary setuid root binary
Last modified: 2016-06-27 11:04:36 EDT
Description of problem:
kdelibs3 includes the setuid root program kgrantpty.
I have audited the content of the binary, as well as the code in kdelibs3, and have come to the following conclusion:
The setuid program DOES ABSOLUTELY NOTHING on a Linux platform with devpts; it is in fact never called. It is invoked via the private method KPty::chownpty() only from KPty::open() or KPty::close(), and in both cases the code to call chownpty() is explicitly bypassed when Unix98 ptys are in use.
Therefore, this binary serves no purpose, and in the interest of reducing the system attack vector, should be dropped.
s/attack vector/attack surface/
as i remember correctly kgrantpty is intended to be used internally by konsole to open a slave pty securely, it performs a setuid chmod and chown on the slave pty device.
Hmmm, kdelibs3 is a compatibility library, making unnecessary changes in it might break things. Are we sure really nothing expects kgrantpty to be there? Have you tried deleting it and then trying legacy kdelibs3 programs to check that they still work? (In particular, if you find anything using the old KonsolePart from kdebase3, that'd be worth testing.) If it's really unnecessary, we can delete it, but I'd like to be reasonably sure that there aren't any legacy programs which expect it to be there.
Look at the source code! kgrantpty is only invoked in a single place, in KPty::chownpty(), which is a private method (not exported from the library); it in turn is only called in two places, both of which have explicit tests for Unix98 PTYs which bypass the call to chownpty().
If something outside kdelibs3 needs kgrantpty then it is a legacy application in its own right and should be packaged into a separate package.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.
(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)
More information and reason for this action is here:
it's fixed in kdelibs3-3.5.10-75.fc25