Bug 2342328

Summary: Fix for SEGV in common-src/security-util.c:sec_tcp_conn_read_callback
Product: [Fedora] Fedora Reporter: Lou Hafer <lou>
Component: amandaAssignee: Jason Tibbitts <j>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 41CC: jridky, j, nuno.dias, orion, pcahyna, phracek, sidsbrmnn
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-12-16 18:33:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix SEGV in sec_tcp_conn_read_callback
none
Add const qualifier to two declarations
none
Patch makefiles to find generated includes for VPATH build. none

Description Lou Hafer 2025-01-27 19:27:11 UTC
Created attachment 2074068 [details]
Fix SEGV in sec_tcp_conn_read_callback

Description of problem:
SEGV in sec_tcp_conn_read_callback due to attempt to read from freed structure


Version-Release number of selected component (if applicable):
3.5.4

How reproducible:
Run amcheck with a disklist that specifies a host that's down.

Steps to Reproduce:
1. As per above
2.
3.

Actual results:
amcheck aborts with SEGV

Expected results:
amcheck reports EOF on read and completes

Additional info:
This has been around since Fed38 --- see closed bug 2192380. The problem is this loop statement:

for (reader_callbacks = rc->reader_callbacks; reader_callbacks != NULL;
     reader_callbacks = reader_callbacks->next) {

The loop executes the callback, which can remove itself from the callbacks list. By the time the loop continuation executes, reader_callbacks may well be freed and reused, resulting in a SEGV.

The attachment fixes the SEGV. Builds on Fed41 from amanda-3.5.4-10.fc41.srcrpm,
(i.e., amanda git tag tag-community-3.5.4 plus patches in the srcrpm) plus this patch and two more that I'll try to add. Compiler warnings are a bit frightening, but runs ok for my simple use case.

Comment 1 Lou Hafer 2025-01-27 19:29:14 UTC
Created attachment 2074069 [details]
Add const qualifier to two declarations

Comment 2 Lou Hafer 2025-01-27 19:30:25 UTC
Created attachment 2074070 [details]
Patch makefiles to find generated includes for VPATH build.

Comment 3 Adam Williamson (Red Hat non-Fedora) 2025-12-02 02:15:19 UTC
This message is a reminder that Fedora Linux 41 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 41 on 2025-12-15.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '41'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 41 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Samyak Jain (RedHat) 2025-12-16 18:33:03 UTC
Fedora Linux 41 entered end-of-life (EOL) status on 2025-12-15.

Fedora Linux 41 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.