nmm1@cus.cam.ac.uk (Nick Maclaren) writes:
> 1) C was designed as a portable, high-level assembler, and its
> scope for user error is the same as assembler. It is several times
> faster to code, but not much faster to debug - as it was designed
> for use as a workbench, that was fine.
frequent exploits in the world involve c-based applications are
buffer overflows
http://www.garlic.com/~lynn/subpubkey.html#overflow
a frequent "mistake" is that target buffer locations lack any
infrastructure defined lengths ... and operations just run over the
end of the buffer.
there are assembler based operations where the underlying
infrastructure have default convention that buffer locations have
encoded lengths and conventional libraries and system support routines
utilize buffer length information whenever buffer operations are
involved ... and the probability of buffer overrun mistakes is
radically less than in typical c language environment.
it is possible, even in assembler coding ... to drastically reduce
certain kinds of coding mistakes if the underlying infrastructure
conventions include simple additional structure ... aka even assembler
environments can have established coding conventions that contributed
to significantly reduced coding errors.
some previous point was that C-language buffer length coding mistakes
can be eliminated if the coder just memorizes all buffer lengths and
faithfully applies that information to every available buffer. Even
in assembler language environments where the buffers carry esplicit
length information, the probability of buffer overrun mistakes can be
drastically reduced ... because of reduced dependancy on human memory
based accounting operations.
i might even assert that the c-language related buffer length
dependancy on humans memorizing every buffer length ... and possibly
having to rememorize them after not having worked on a program for a
period of months ... is analogous to the security shared secret
conventions ... where people are assumed to correctly memorize scores
of passwords ... even those that they use infrequently used:
http://www.garlic.com/~lynn/subpubkey.html#secrets
--
Anne & Lynn Wheeler | http://www.garlic.com/~lynn/
Received on Thu Sep 29 21:41:01 2005