SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
I am submitting this report to this list for documentation, perspectives
and, hopefully, helpful assistance towards resolving this issue. Sorry
in advance for the length of this post.
First reported to the Unofficial Wiki + Bugzilla of the ATI fglrx
binary, then to AMD/ATI technical support was the following issue:
I have the following configuration:
* Lenovo Thinkpad T60p
* ATI Mobility FireGL V5250 graphics card
* version 8.52.3 of the fglrx module
* Fedora 8 running version 2.6.25.14-69.fc8 of the GNU/Linux kernel
*NOTE: I have upgraded the kernel and driver from the first indications
of the problem; hence, older versions are in the bug report below.
However, the same bug persists according to both symptoms and to the
security log.
At intermittent start-ups of the X server using the fglrx driver the X
server does not display due to a security compatibility problem between
the fglrx driver and the secure SELinux module of the GNU/linux kernel.
The following is the report from the system log outlining the problem:
To report issues with Linux drivers you can submit an online
ticket using the “Linux Driver Feedback” category, and your
report will be received and reviewed/tested by our driver team.
Please note that your report will only be responded to if we
require additional information. We do not respond to all support
inquires.
For the Linux Driver Feedback submission page, visit.
---------------- End of response -----------------
I could disable SELinux and I would not have this problem; however, I
was hoping that there was a much secure or safer work-around to this
problem.
Peace,
Frank
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-25-2008, 01:13 PM
Eric Paris
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Thu, 2008-09-25 at 14:15 +1000, James Morris wrote:
> On Wed, 24 Sep 2008, Francis K Shim wrote:
>
> >
> > I could disable SELinux and I would not have this problem; however, I
> > was hoping that there was a much secure or safer work-around to this
> > problem.
>
> The video driver is inherently dangerous, so the safe approach is not to
> use it.
James isn't exactly being helpful, but the reason is because as you
guessed the problem lies squarely and obviously with AMD/ATI and there
isn't much we can do to help with closed source proprietary software.
AMD/ATI is obviously doing it wrong and when it comes to security doing
it wrong is never a good idea. Sadly we don't have their source so I
can't show you the line of code (or do anything to fix it), but your
backtrace should make it pretty obvious if anyone inside ATI decides to
care.
Stephen James, what do the two of you think about something like this?
Maybe a WARN_ONCE() ?
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 03fc6a8..14f1242 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1385,7 +1385,8 @@ static int task_has_capability(struct task_struct *tsk,
default:
printk(KERN_ERR
"SELinux: out of range capability %d
", cap);
- BUG();
+ WARN();
+ return -EPERM;
}
return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
}
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-25-2008, 02:28 PM
"Christopher J. PeBenito"
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Thu, 2008-09-25 at 09:13 -0400, Eric Paris wrote:
> On Thu, 2008-09-25 at 14:15 +1000, James Morris wrote:
> > On Wed, 24 Sep 2008, Francis K Shim wrote:
> >
> > >
> > > I could disable SELinux and I would not have this problem; however, I
> > > was hoping that there was a much secure or safer work-around to this
> > > problem.
> >
> > The video driver is inherently dangerous, so the safe approach is not to
> > use it.
>
> James isn't exactly being helpful, but the reason is because as you
> guessed the problem lies squarely and obviously with AMD/ATI and there
> isn't much we can do to help with closed source proprietary software.
> AMD/ATI is obviously doing it wrong and when it comes to security doing
> it wrong is never a good idea. Sadly we don't have their source so I
> can't show you the line of code (or do anything to fix it), but your
> backtrace should make it pretty obvious if anyone inside ATI decides to
> care.
>
> Stephen James, what do the two of you think about something like this?
> Maybe a WARN_ONCE() ?
Maybe instead of returning -EPERM unconditionally, returning based on
the unknown_perms setting? Of course what to do if its set to reject
would be a question (my suggestion would be deny on that too).
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-26-2008, 03:38 AM
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Fri, 26 Sep 2008 00:31:09 +1000, James Morris said:
> - Francis asked for a much-secure or safer workaround to the issue.
> Given that the driver is messing with kernel security, is also broken in
> its use of a security API, and not maintained, I'm certainly not going to
> recommend its continued use in this context.
Given the fact it's a kernel BUG, I wonder if the *real* issue isn't
that the driver doesn't support SELinux, but that it doesn't understand
the expanded more-than-32-bits capabilities in recent kernels, causing
something to overlay something it shouldn't have...
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-26-2008, 08:00 PM
Francis K Shim
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Thu, 2008-09-25 at 23:38 -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 26 Sep 2008 00:31:09 +1000, James Morris said:
>
> > - Francis asked for a much-secure or safer workaround to the issue.
> > Given that the driver is messing with kernel security, is also broken in
> > its use of a security API, and not maintained, I'm certainly not going to
> > recommend its continued use in this context.
>From the perspective of security and safety, I agree with James in
simply *not* using the fglrx driver, in favor of a VESA or compatible
open-source device driver; however, that being said, it will essentially
cripple the usage of the full range of the video card's capabilities.
It is acceptable if I were to only be limited to simple text editing and
low intensity graphics. However, it does mean that any photo-realistic
and intense graphics manipulation will suffer, which I can live with for
a little while, but not forever.
> Given the fact it's a kernel BUG, I wonder if the *real* issue isn't
> that the driver doesn't support SELinux, but that it doesn't understand
> the expanded more-than-32-bits capabilities in recent kernels, causing
> something to overlay something it shouldn't have...
If this is the case, then I would be happy to tell AMD/ATI about this
interface bug; however, I think that SELinux itself, Linux and the
Open-source community should use incidences like this as further
proof-of-application (versus proof-of-concept). At least, in this
respect, there should be an opportunity for strengthening liason between
*us* and the AMD/ATI team.
Peace,
Frank
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-29-2008, 01:13 PM
Stephen Smalley
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Thu, 2008-09-25 at 09:13 -0400, Eric Paris wrote:
> On Thu, 2008-09-25 at 14:15 +1000, James Morris wrote:
> > On Wed, 24 Sep 2008, Francis K Shim wrote:
> >
> > >
> > > I could disable SELinux and I would not have this problem; however, I
> > > was hoping that there was a much secure or safer work-around to this
> > > problem.
> >
> > The video driver is inherently dangerous, so the safe approach is not to
> > use it.
>
> James isn't exactly being helpful, but the reason is because as you
> guessed the problem lies squarely and obviously with AMD/ATI and there
> isn't much we can do to help with closed source proprietary software.
> AMD/ATI is obviously doing it wrong and when it comes to security doing
> it wrong is never a good idea. Sadly we don't have their source so I
> can't show you the line of code (or do anything to fix it), but your
> backtrace should make it pretty obvious if anyone inside ATI decides to
> care.
>
> Stephen James, what do the two of you think about something like this?
> Maybe a WARN_ONCE() ?
>
> security/selinux/hooks.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 03fc6a8..14f1242 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -1385,7 +1385,8 @@ static int task_has_capability(struct task_struct *tsk,
> default:
> printk(KERN_ERR
> "SELinux: out of range capability %d
", cap);
> - BUG();
> + WARN();
> + return -EPERM;
> }
> return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
> }
I'm not opposed to changing it to an error return, although I'm not
clear that will help.
Does anyone know what the driver is actually trying to do here? The
message said:
SELinux: out of range capability -157851600
and -157851600 == 0xf6976030
Obviously that isn't what they meant to pass to capable().
--
Stephen Smalley
National Security Agency
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-29-2008, 01:31 PM
Eric Paris
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Mon, 2008-09-29 at 09:13 -0400, Stephen Smalley wrote:
> On Thu, 2008-09-25 at 09:13 -0400, Eric Paris wrote:
> > On Thu, 2008-09-25 at 14:15 +1000, James Morris wrote:
> > > On Wed, 24 Sep 2008, Francis K Shim wrote:
> > >
> > > >
> > > > I could disable SELinux and I would not have this problem; however, I
> > > > was hoping that there was a much secure or safer work-around to this
> > > > problem.
> > >
> > > The video driver is inherently dangerous, so the safe approach is not to
> > > use it.
> >
> > James isn't exactly being helpful, but the reason is because as you
> > guessed the problem lies squarely and obviously with AMD/ATI and there
> > isn't much we can do to help with closed source proprietary software.
> > AMD/ATI is obviously doing it wrong and when it comes to security doing
> > it wrong is never a good idea. Sadly we don't have their source so I
> > can't show you the line of code (or do anything to fix it), but your
> > backtrace should make it pretty obvious if anyone inside ATI decides to
> > care.
> >
> > Stephen James, what do the two of you think about something like this?
> > Maybe a WARN_ONCE() ?
> >
> > security/selinux/hooks.c | 3 ++-
> > 1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> > index 03fc6a8..14f1242 100644
> > --- a/security/selinux/hooks.c
> > +++ b/security/selinux/hooks.c
> > @@ -1385,7 +1385,8 @@ static int task_has_capability(struct task_struct *tsk,
> > default:
> > printk(KERN_ERR
> > "SELinux: out of range capability %d
", cap);
> > - BUG();
> > + WARN();
> > + return -EPERM;
> > }
> > return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
> > }
>
> I'm not opposed to changing it to an error return, although I'm not
> clear that will help.
>
> Does anyone know what the driver is actually trying to do here? The
> message said:
> SELinux: out of range capability -157851600
> and -157851600 == 0xf6976030
> Obviously that isn't what they meant to pass to capable().
I don't think any of us have any idea what the driver was trying to do
here, but clearly they are doing it wrong. Maybe you can turn on your
NSA brain reading satellite and peer into the brain of an ATI
programmer....
I'm actually quite shocked it didn't blow up in cap_raised
its just got to be darn lucky that c.cap[huge index] actually hit a
legal spot of memory and didn't bug on a pagefault right there. (I'm
pretty sure 64 bit capabilities were in 2.6.25 right?) Before 64 bit
caps I don't think we had the array index and only had the mask, so
something huge wouldn't explode in the cap code...
We can turn this into a WARN_ONCE() but people with this driver would
still be taking a walk on the wild side since there is no bounds
checking what-so-ever in the cap code....
I feel your pain, and we can make the kernel stop BUGing in SELinux
code, but after looking at the cap code that it already ran your just as
likely to BUG even without SELinux (and not nearly as cleanly...)
I'm sorry to say I think its probably best for us to leave the BUG so at
least the kernel will explode predictably rather than randomly and in a
harder to track down way...
I wonder if I should propose adding a cap_valid() check to cap_capable()
upstream...
-Eric
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-30-2008, 02:08 PM
Eric Paris
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
On Mon, 2008-09-29 at 09:31 -0400, Eric Paris wrote:
> I wonder if I should propose adding a cap_valid() check to cap_capable()
> upstream...
Couple minutes on kernelopps.org showed that almost 3000 others had this
same problem. So anyway, the problem is absolutely in the firegl code
but I did propose something upstream to try to hopefully keep people's
computers alive. We'll see what the comments are....
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
09-30-2008, 04:57 PM
Francis K Shim
SELinux detects problem with proprietary binary fglrx driver; however, AMD/ATI will not help
Thanks for the further information.
Eric, I hope you do not mind, but I forwarded this information to the
AMD/ATI technical support using their ticket system.
I am hoping that somehow a light-bulb will actually go off among the
"customer technical support" crew to actually forward this and past
information to their actual coders/programmers.
Peace,
Frank
On Tue, 2008-09-30 at 10:08 -0400, Eric Paris wrote:
> 2
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list