Patch: revert uc_malloc use in des.c
Bernd Schmidt
bernds_cb1 at t-online.de
Sun Jun 8 13:35:46 UTC 2008
I think a good case can be made for reverting most uses of uc_malloc,
but this one is probably the top contender, so I'll start with it.
Here's the reasons:
- the manpage of crypt doesn't mention calling "exit" as a possible
failure mode.
IMO, it is be much better if a program that uses libcrypt failed
to load due to out-of-memory rather than suddenly aborting when
about to encrypt something (errors during exec are much more likely
to be caught)
- allocating 70k at run time is an order-5 allocation on nommu Linux
with 4k pages, so failure is not even unlikely. At a minimum, a
sane implementation using uc_malloc would use multiple independent
allocations.
- reverting it adds back 70k BSS to libcrypt, but I expect not too many
programs link with it, and those that do are likely to need the data
anyway.
To summarize, as it exists now the code is less robust than it used to
be (especially on nommu systems). Are there any objections if I apply
the patch below (which reverts revision 19342)?
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: undo-crypt-damage.diff
Type: text/x-patch
Size: 5480 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20080608/e8ce8bbf/attachment-0002.bin
More information about the uClibc
mailing list