[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.1.10.0810010008130.2068@tundra.namei.org>
Date: Wed, 1 Oct 2008 00:23:45 +1000 (EST)
From: James Morris <jmorris@...ei.org>
To: Eric Paris <eparis@...hat.com>
cc: linux-kernel@...r.kernel.org, sds@...ho.nsa.gov, morgan@...nel.org,
serue@...ibm.com, selinux@...ho.nsa.gov
Subject: Re: [PATCH] capability: WARN when invalid capability is requested
rather than BUG/panic
On Tue, 30 Sep 2008, Eric Paris wrote:
> This patch adds a WARN_ONCE() to cap_capable() so we will stop
> dereferencing random spots of memory and will cleanly tell the obviously
> broken driver that it doesn't have that ridiculous permissions. No idea
> if the driver is going to handle EPERM but anything that calls capable
> and doesn't expect a denial has got to be the worst piece of code ever
> written..... I could return EINVAL, but I think its clear that noone
> has capabilities over 64 so clearly they don't have that permission.
>
> This 'could' be considered a regression since 2.6.24. Neither SELinux
> nor the capabilities system had a problem with ginormous request values
> until we got 64 bit support, although this is OBVIOUSLY a bug with the
> out of tree closed source driver....
An issue here is whether we should be adding workarounds in the mainline
kernel for buggy closed drivers. Papering over problems rather than
getting them fixed does not seem like a winning approach. Especially
problems which are unexpectedly messing with kernel security APIs.
Also, won't this encourage vendors of such drivers to continue with this
behavior, while discouraging those vendors who are doing the right thing?
Do we know if this even really helps the user? For all we know, the
driver may simply crash differently with an -EPERM.
- James
--
James Morris
<jmorris@...ei.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists