When being explicit is too much hassle
[Posted December 4, 2002 by corbet]
One of the cardinal rules for security-oriented programming is to deny
anything that you have not decided, explicitly, to allow. The Linux
Security Modules project, which has its code partially merged into the 2.5
development kernel, was designed around this rule: the author of a security
module is required to provide an implementation for every one of the
(many) hooks provided by LSM. The LSM designers were worried that module
authors could miss the addition of new hooks in the future, and thus
unwittingly allow actions that their security regime was intended to
prevent. By requiring an implementation of every hook, LSM ensured that
module authors would always see - and deal with - any changes.
The real result, however, was that real-world security modules were bloated
by boilerplate stub implementations of dozens of unused hooks. It also was
difficult to make modules portable across multiple kernel versions. Greg
Kroah-Hartman finally got tired of all this, and posted a patch which removes the "implement all hooks"
requirement. There has not been any real opposition to this change; it
will likely go to Linus soon.
Security issues often go this way. The real-world costs of proposed
security regimes reach a level where they outweigh the benefits. At that
point, the best thing to do can be to back off before people start to
develop unofficial ways around overly onerous requirements.
(
Log in to post comments)