Red Hat Bugzilla – Bug 232096
CVE-2004-0813 SG_IO unsafe user command execution
Last modified: 2007-11-30 17:07:10 EST
bug 133098 describes a flaw in the way the kernel handles certain SG_IO
commands. A user who has access to a /dev/sg file, can do scary things they
shouldn't be able to. In RHEL3 we currently give the console user read/write
access to /dev/sg devices which are also recordable CD drives. This is
obviously a problem.
Fixing this in the kernel will be nearly impossible given how the RHEL3 kernel
works. We can however fix it by changing the way cdrecord works.
If we use consolehelper to launch cdrecord, the end user should notice no change
in behavior, and will allow us to control who is able to execute cdrecord as the
If we set cdrecord to be setuid root, we will need to add the patch for
CVE-2004-0806, which could allow a local user to gain root privileges. We will
also need to add a fix for bug 152462 (CVE-2005-0866). There is a patch in the bug.
Neither of these are currently vulnerabilities, but would be if we set cdrecord
to setuid root.
Created attachment 150154 [details]
Patch for CVE-2004-0806
See the original bug 133098 for patch adding PAM support to cdrecord + PAM config.
Cdrecord with the patch mentioned above can be made setuid root and only people
logged in on console will have access to it.
(Note that using consolehelper doesn't help us as it sets both euid and uid to 0.)
harald, can you roll new packages with all the patches mentioned and just note
te n-v-r here. It's likely we'll include these packges with the pam errata
given they depend on each other.
scsi-remote will not work with the pam patch anyway, if I think of it. So we may
note that this functionality is gone. And we could remove the code also.
I think as long as we note this loss of functionality in the errata, removing it
is the right thing.
Patch with pam and make them suid also?
I suspect we would only need to modify these tools if they need to write to the
device no? Can they not read from the cd device, rather than the sg device?
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.