Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 255131 - app-crypt/mhash-0.9.9 segfaults with NULL digest in whirlpool/snefru
Summary: app-crypt/mhash-0.9.9 segfaults with NULL digest in whirlpool/snefru
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-16 05:31 UTC by Thomas Harning
Modified: 2009-04-12 21:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix snefru's segfault (mhash_snefru_segfault.patch,310 bytes, patch)
2009-01-16 05:32 UTC, Thomas Harning
Details | Diff
patch to fix whirlpool's segfault (mhash_whirlpool_segfault.patch,316 bytes, patch)
2009-01-16 05:32 UTC, Thomas Harning
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Harning 2009-01-16 05:31:27 UTC
The package app-crypt/mhash-0.9.9 as well as app-crypt/mhash-0.9.9-r1 are affected by a bug which causes a NULL ptr dereference in whirlpool/snefru digest-completion functionality.

In this patch, whirlpool and snefru's code is updated to bail if 'digest' is NULL.  The code portion aborted is only responsible for writing data to the digest, so this appears to be correct behavior.

Patch already submitted upstream, but depending on speed, this may be faster to patch in a new patchset.

Reproducible: Always

Steps to Reproduce:
/* for each of MHASH_SNEFRU128, MHASH_SNEFRU256, MHASH_WHIRLPOOL */
MHASH hash = mhash_init(alg);
mhash_deinit(hash, NULL);

Actual Results:  
Segfault caused by attempt to write to NULL-ptr-based location

Expected Results:  
MHASH object to be de-initialized without writing out the hash results.
Comment 1 Thomas Harning 2009-01-16 05:32:04 UTC
Created attachment 178666 [details, diff]
patch to fix snefru's segfault
Comment 2 Thomas Harning 2009-01-16 05:32:27 UTC
Created attachment 178667 [details, diff]
patch to fix whirlpool's segfault
Comment 3 Wormo (RETIRED) gentoo-dev 2009-01-16 06:42:39 UTC
Thanks for submitting your fix; assigning to maintainer.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-04-12 21:44:20 UTC
InCVS.