Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 255131

Summary: app-crypt/mhash-0.9.9 segfaults with NULL digest in whirlpool/snefru
Product: Gentoo Linux Reporter: Thomas Harning <harningt>
Component: [OLD] LibraryAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to fix snefru's segfault
patch to fix whirlpool's segfault

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.