Bug 902430 - OBJ_nid2obj() returns object in read-only storage.
Summary: OBJ_nid2obj() returns object in read-only storage.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: openssl
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-21 16:36 UTC by Patrick Monnerat
Modified: 2013-01-22 14:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-22 14:18:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test program (387 bytes, text/x-c++src)
2013-01-21 16:36 UTC, Patrick Monnerat
no flags Details

Description Patrick Monnerat 2013-01-21 16:36:51 UTC
Created attachment 684439 [details]
Test program

Description of problem:
The OBJ_nid2obj() procedure (value declared as ASN1_OBJECT *) returns now a pointer to an object stored in a read-only section, causing a segfault if the caller tries to update some object field.

Version-Release number of selected component (if applicable):
1.0.1c-7

How reproducible:
Always in F18, not in F17 and before.

Steps to Reproduce:
1. Compile and run the attachment nid2obj-bug.c: cc -g nid2obj-bug.c -lssl -lcrypto
  
Actual results:
Object address: 0xaabbccdd
Segmentation fault (core dumped)

Expected results:
Object address: 0xddccbbaa
Success


Additional info:
- Either OBJ_nid2obj() should be declared as const or it should work.
- Calling OBJ_dup() on the result does not help because static objects are NOT duplicated :-(
This bug is the cause of ocspd bug #901793 for which I'm in charge.

Please fix or give me a hint. Thanks in advance.

Comment 1 Patrick Monnerat 2013-01-21 18:28:21 UTC
I just noticed the test action is semantically erroneous.
Although this may cause eventual real problems, this one just exhibited a real bug in ocspd. Thus this is not a blocker for me anymore and its importance is much lowered.
Sorry for the noise.

Comment 2 Tomas Mraz 2013-01-22 08:00:43 UTC
I'd suggest reporting the bug upstream by simply mailing the description to rt.

Comment 3 Patrick Monnerat 2013-01-22 14:18:39 UTC
Done, thanks for the advice. Closing.


Note You need to log in before you can comment on or make changes to this bug.