Bug 2226749

Summary: double free and abort in annocheck
Product: [Fedora] Fedora Reporter: Václav Kadlčík <vkadlcik>
Component: annobinAssignee: Nick Clifton <nickc>
Status: MODIFIED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: fweimer, jakub, nickc, sipoyare, yahmad
Target Milestone: ---Keywords: Bugfix, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: annobin-12.22-1.fc39 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Václav Kadlčík 2023-07-26 12:28:15 UTC
Newest rawhide annobin crashes on a test binary.
Affected: annobin-12.21-1.fc39
Works fine in annobin-12.20-2.fc39.

Reproducible: Always

Steps to Reproduce:
1. Download https://src.fedoraproject.org/tests/annobin/blob/main/f/Regression/wrong-compiler-flags-but-no-failure/files/main_with_gaps_in_notes
2. annocheck --fixed-format-messages main_with_gaps_in_notes

Actual Results:  
annocheck: Version 12.21.
Hardened: PASS: test: pie file: main_with_gaps_in_notes.
Hardened: PASS: test: optimization file: main_with_gaps_in_notes.
Hardened: PASS: test: pic file: main_with_gaps_in_notes.
Hardened: PASS: test: lto file: main_with_gaps_in_notes.
Hardened: PASS: test: stack-prot file: main_with_gaps_in_notes.
Hardened: PASS: test: writable-got file: main_with_gaps_in_notes.
Hardened: PASS: test: dynamic-segment file: main_with_gaps_in_notes.
Hardened: PASS: test: bind-now file: main_with_gaps_in_notes.
Hardened: PASS: test: glibcxx-assertions file: main_with_gaps_in_notes.
Hardened: PASS: test: stack-clash file: main_with_gaps_in_notes.
Hardened: PASS: test: entry file: main_with_gaps_in_notes.
Hardened: PASS: test: gnu-stack file: main_with_gaps_in_notes.
Hardened: PASS: test: gnu-relro file: main_with_gaps_in_notes.
free(): double free detected in tcache 2
Aborted (core dumped)

Expected Results:  
With the previous version, I get the following report:

annocheck: Version 12.20.
Hardened: PASS: test: pie file: main_with_gaps_in_notes.
Hardened: PASS: test: optimization file: main_with_gaps_in_notes.
Hardened: PASS: test: pic file: main_with_gaps_in_notes.
Hardened: PASS: test: lto file: main_with_gaps_in_notes.
Hardened: PASS: test: stack-prot file: main_with_gaps_in_notes.
Hardened: PASS: test: writable-got file: main_with_gaps_in_notes.
Hardened: PASS: test: dynamic-segment file: main_with_gaps_in_notes.
Hardened: PASS: test: bind-now file: main_with_gaps_in_notes.
Hardened: PASS: test: glibcxx-assertions file: main_with_gaps_in_notes.
Hardened: PASS: test: stack-clash file: main_with_gaps_in_notes.
Hardened: PASS: test: entry file: main_with_gaps_in_notes.
Hardened: PASS: test: gnu-stack file: main_with_gaps_in_notes.
Hardened: PASS: test: gnu-relro file: main_with_gaps_in_notes.
Hardened: FAIL: test: gaps file: main_with_gaps_in_notes.
Hardened: PASS: test: notes file: main_with_gaps_in_notes.
Hardened: FAIL: test: cf-protection file: main_with_gaps_in_notes.
Hardened: PASS: test: fast file: main_with_gaps_in_notes.
Hardened: PASS: test: instrumentation file: main_with_gaps_in_notes.
Hardened: PASS: test: production file: main_with_gaps_in_notes.
Hardened: FAIL: test: property-note file: main_with_gaps_in_notes.
Hardened: PASS: test: run-path file: main_with_gaps_in_notes.
Hardened: PASS: test: rwx-seg file: main_with_gaps_in_notes.
Hardened: PASS: test: short-enums file: main_with_gaps_in_notes.
Hardened: PASS: test: textrel file: main_with_gaps_in_notes.
Hardened: PASS: test: threads file: main_with_gaps_in_notes.
Hardened: PASS: test: unicode file: main_with_gaps_in_notes.
Hardened: Rerun annocheck with --verbose to see more information on the tests.
Hardened: main_with_gaps_in_notes: Overall: FAIL.

Comment 1 Nick Clifton 2023-07-26 14:20:28 UTC
snafu introduced when trying to fix a covscan complaint about a resource leak....

Comment 2 Nick Clifton 2023-07-26 14:38:51 UTC
Fixed with annobin-12.22-1.fc39.

Comment 3 Václav Kadlčík 2023-07-27 06:09:06 UTC
(In reply to Nick Clifton from comment #2)
> Fixed with annobin-12.22-1.fc39.

ack, thanks

Comment 4 Fedora Release Engineering 2023-08-16 08:13:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.