View Issue Details

IDProjectCategoryView StatusLast Update
0008072Talerexchangepublic2024-03-07 19:49
Reporterfefe Assigned Tooec Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.9.4Fixed in Version0.9.4 
Summary0008072: csr_withdraw_done: use after free, double free
DescriptionThis is in exchange/src/lib/exchange_api_age_withdraw.c:

 839 {
 840 GNUNET_break (0);
 841 TALER_EXCHANGE_age_withdraw_cancel (awh);
 842 break;
 843 }

the break leaves the do-while-loop from 829 to 855. Same here:

 849 {
 850 GNUNET_break (0);
 851 TALER_EXCHANGE_age_withdraw_cancel (awh);
 852 break;
 853 }

This is the first statement after the do-while-loop:

 855 } while(0);
 856
 857 awh->csr.pending--;

The code then also does other things with awh, but only of success is true, which it would not be if one of the two breaks was taken.
However, at the very end, the code does this:

 868 TALER_EXCHANGE_age_withdraw_cancel (awh);

which, among other things, tries to call free again.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

fefe

2024-01-11 18:14

reporter   ~0020866

The second fail clause apparently can't be triggered because the called function (TALER_coin_ev_hash) always returns success. Maybe we can make it a void function then and get rid of the handling of errors that can never happen?

Christian Grothoff

2024-01-11 18:17

manager   ~0020867

Yes, I agree, hash functions should not fail, so we should change it to return void. @oec: will you do it?

oec

2024-01-11 18:31

developer   ~0020868

Yes, I'll fix the issue and change the signature.

oec

2024-01-12 11:00

developer   ~0020871

Fixed with a6b35ee7d345aa11e0388733fb95f3a4d2e52180

Issue History

Date ModifiedUsernameFieldChange
2024-01-11 18:11fefeNew Issue
2024-01-11 18:11fefeStatusnew => assigned
2024-01-11 18:11fefeAssigned To => Christian Grothoff
2024-01-11 18:13Christian GrothoffAssigned ToChristian Grothoff => oec
2024-01-11 18:14fefeNote Added: 0020866
2024-01-11 18:17Christian GrothoffNote Added: 0020867
2024-01-11 18:31oecNote Added: 0020868
2024-01-12 11:00oecStatusassigned => informing
2024-01-12 11:00oecResolutionopen => fixed
2024-01-12 11:00oecFixed in Version => git (master)
2024-01-12 11:00oecNote Added: 0020871
2024-01-25 21:29Christian GrothoffFixed in Versiongit (master) => 0.9.4
2024-01-25 21:29Christian GrothoffTarget Version => 0.9.4
2024-03-07 19:49Christian GrothoffStatusinforming => closed