osafamfd NULL-pointer dereference at sg.cc:930 - nonmatching DELETE of saAmfSGType on locked SG crashes the active AMF director and reboots the node.
From sg.cc, ccb_apply_modify_hdlr walks the attrMods list of the CCB modify operation. For each mod it sets up 2 things:
void *value = nullptr;
...
if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
(attribute->attrValues == nullptr)) {
/* Attribute value is deleted, revert to default value */
value_is_deleted = true; // value stays NULL
} else {
/* Attribute value is modified */
value_is_deleted = false;
value = attribute->attrValues[0];
}
For DELETE mods, value is never assigned, every attribute branch checks value_is_deleted and reverts to a default instead of touching value, except the saAmfSGType:
if (!strcmp(attribute->attrName, "saAmfSGType")) {
SaNameT sg_type_name = *((SaNameT *)value); // NULL deref on DELTE
The execution flow for saAmfSGType:
Test scenario:
Expected: CCB rejected with a validation error.
Observed: "The system is going down for reboot NOW!" —
amfd SIGSEGV, nid reboots the node.
Reproduced output:
#1. create an empty SG:
SC-2-1:~ # immcfg -c SaAmfSG \
-a 'saAmfSGType=safVersion=4.0.0,safSgType=OpenSafSgTypeNoRed' \
safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=1
#2. lock the SG
SC-2-1:~ # immadm -o 2 safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=2
#3. delete a value that isn't there (SG is NoRed, delete 2N)
SC-2-1:~ # immcfg -a 'saAmfSGType-=safVersion=4.0.0,safSgType=OpenSafSgType2N' \
> safSg=repro930,safApp=safAmfService ; echo "rc=$?"
rc=0
The system is going down for reboot NOW!
The same single command also crashes saAmfSUType and saAmfCompType:
Hi Nguyen,
The ticket is giving very little description. Can you please add reproducable steps? What is the scenario?
Thanks,
Nagendra, nagendra@gethighavailability.com
contact@gethighavailability.com
High Availability Solutions
Hi Nagendra,
Thanks for the quick review.
I have pushed the full reproduction case into the description.
I will update a suggested fix patch later.
Regards,
Hau
Reproduced saAmfSUType:
also lock-in:
Last edit: Nguyen Tran Trung Hau 2026-10-09
Reproduced saAmfCompType — same crash, no admin lock needed:
Reproduced saAmfCSType — same DELETE mishandling, but no crash.
Instead it silently diverges the amfd-internal model from IMM.
Trigger — DELETE
Diff:
Thanks Nguyen, wonderful, good catch!
Thanks,
Nagendra, nagendra@gethighavailability.com
contact@gethighavailability.com
High Availability Solutions
Hi Nguyen,
The fix looks good to me, ack.
Thanks,
Nagendra, nagendra@gethighavailability.com nagendra@gethighavailability.com
contact@gethighavailability.com contact@gethighavailability.com
High Availability Solutions
From: Nguyen Tran Trung Hau via Opensaf-tickets opensaf-tickets@lists.sourceforge.net
Sent: 19 October 2026 13:57
To: opensaf-tickets@lists.sourceforge.net
Cc: Nguyen Tran Trung Hau trunghau963@users.sourceforge.net
Subject: [tickets] [opensaf:tickets] #3406 amf: amfd crashes on delete of non-matching type attribute value (attr-=)
[tickets:#3406] https://sourceforge.net/p/opensaf/tickets/3406/ amf: amfd crashes on delete of non-matching type attribute value (attr-=)
Status: review
Milestone: 5.27.01
Created: Fri Oct 09, 2026 07:27 AM UTC by Nguyen Tran Trung Hau
Last Updated: Fri Oct 09, 2026 10:23 AM UTC
Owner: Nguyen Tran Trung Hau
osafamfd NULL-pointer dereference at sg.cc:930 - nonmatching DELETE of saAmfSGType on locked SG crashes the active AMF director and reboots the node.
From sg.cc, ccb_apply_modify_hdlr walks the attrMods list of the CCB modify operation. For each mod it sets up 2 things:
void value = nullptr;
...
if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
(attribute->attrValues == nullptr)) {
/ Attribute value is deleted, revert to default value /
value_is_deleted = true; // value stays NULL
} else {
/ Attribute value is modified */
value_is_deleted = false;
value = attribute->attrValues[0];
}
For DELETE mods, value is never assigned, every attribute branch checks value_is_deleted and reverts to a default instead of touching value, except the saAmfSGType:
if (!strcmp(attribute->attrName, "saAmfSGType")) {
SaNameT sg_type_name = ((SaNameT )value); // NULL deref on DELTE
The execution flow for saAmfSGType:
and does "continue" (sg.cc:617-618) — DELETE approved unchecked.
(sg.cc:919-927).
value without checking value_is_deleted (sg.cc:929-930):
"SaNameT sg_type_name = ((SaNameT )value)" — NULL deref.
calls opensaf_reboot() — the node reboots. rc=0 at the client because
immModel_ccbCommit completes before the apply upcall reaches the OI.
Test scenario:
reject admin operations)
Expected: CCB rejected with a validation error.
Observed: "The system is going down for reboot NOW!" —
amfd SIGSEGV, nid reboots the node.
Reproduced output:
1. create an empty SG:
SC-2-1:~ # immcfg -c SaAmfSG \
-a 'saAmfSGType=safVersion=4.0.0,safSgType=OpenSafSgTypeNoRed' \
safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=1
2. lock the SG
SC-2-1:~ # immadm -o 2 safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=2
3. delete a value that isn't there (SG is NoRed, delete 2N)
SC-2-1:~ # immcfg -a 'saAmfSGType-=safVersion=4.0.0,safSgType=OpenSafSgType2N' \
The same single command also crashes saAmfSUType and saAmfCompType:
NO admin-state gate: crashes in any SU state.
no comptype, avd_comptype_add_comp() derefs comp->comp_type=NULL.
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net opensaf-tickets@lists.sourceforge.net is subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Related
Tickets:
#3406Tickets: tickets
Hi Nguyen,
Do you see the similar issues in other objects like SU, SI, etc.?
Thanks,
Mohan, contact@gethighavailability.com
High Availability Solutions
From: Nagendra Kumar via Opensaf-tickets [mailto:opensaf-tickets@lists.sourceforge.net]
Sent: 19 October 2026 17:26
To: opensaf-tickets@lists.sourceforge.net
Cc: Nagendra Kumar
Subject: [tickets] [opensaf:tickets] Re: #3406 amf: amfd crashes on delete of non-matching type attribute value (attr-=)
Hi Nguyen,
The fix looks good to me, ack.
Thanks,
Nagendra, nagendra@gethighavailability.com nagendra@gethighavailability.com
contact@gethighavailability.com contact@gethighavailability.com
High Availability Solutions
From: Nguyen Tran Trung Hau via Opensaf-tickets opensaf-tickets@lists.sourceforge.net
Sent: 19 October 2026 13:57
To: opensaf-tickets@lists.sourceforge.net
Cc: Nguyen Tran Trung Hau trunghau963@users.sourceforge.net
Subject: [tickets] https://sourceforge.net/p/opensaf/tickets/_discuss/ [opensaf:tickets] #3406 amf: amfd crashes on delete of non-matching type attribute value (attr-=)
[tickets:#3406] https://sourceforge.net/p/opensaf/tickets/3406/ https://sourceforge.net/p/opensaf/tickets/3406/ amf: amfd crashes on delete of non-matching type attribute value (attr-=)
Status: review
Milestone: 5.27.01
Created: Fri Oct 09, 2026 07:27 AM UTC by Nguyen Tran Trung Hau
Last Updated: Fri Oct 09, 2026 10:23 AM UTC
Owner: Nguyen Tran Trung Hau
osafamfd NULL-pointer dereference at sg.cc:930 - nonmatching DELETE of saAmfSGType on locked SG crashes the active AMF director and reboots the node.
From sg.cc, ccb_apply_modify_hdlr walks the attrMods list of the CCB modify operation. For each mod it sets up 2 things:
void value = nullptr;
...
if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
(attribute->attrValues == nullptr)) {
/ Attribute value is deleted, revert to default value /
value_is_deleted = true; // value stays NULL
} else {
/ Attribute value is modified */
value_is_deleted = false;
value = attribute->attrValues[0];
}
For DELETE mods, value is never assigned, every attribute branch checks value_is_deleted and reverts to a default instead of touching value, except the saAmfSGType:
if (!strcmp(attribute->attrName, "saAmfSGType")) {
SaNameT sg_type_name = ((SaNameT )value); // NULL deref on DELTE
The execution flow for saAmfSGType:
and does "continue" (sg.cc:617-618) — DELETE approved unchecked.
(sg.cc:919-927).
value without checking value_is_deleted (sg.cc:929-930):
"SaNameT sg_type_name = ((SaNameT )value)" — NULL deref.
calls opensaf_reboot() — the node reboots. rc=0 at the client because
immModel_ccbCommit completes before the apply upcall reaches the OI.
Test scenario:
reject admin operations)
Expected: CCB rejected with a validation error.
Observed: "The system is going down for reboot NOW!" —
amfd SIGSEGV, nid reboots the node.
Reproduced output:
SC-2-1:~ # immcfg -c SaAmfSG \
-a 'saAmfSGType=safVersion=4.0.0,safSgType=OpenSafSgTypeNoRed' \
safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=1
SC-2-1:~ # immadm -o 2 safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=2
SC-2-1:~ # immcfg -a 'saAmfSGType-=safVersion=4.0.0,safSgType=OpenSafSgType2N' \
safSg=repro930,safApp=safAmfService ; echo "rc=$?"
rc=0
The system is going down for reboot NOW!
The same single command also crashes saAmfSUType and saAmfCompType:
NO admin-state gate: crashes in any SU state.
no comptype, avd_comptype_add_comp() derefs comp->comp_type=NULL.
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net opensaf-tickets@lists.sourceforge.net is subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
[tickets:#3406] https://sourceforge.net/p/opensaf/tickets/3406/ amf: amfd crashes on delete of non-matching type attribute value (attr-=)
Status: review
Milestone: 5.27.01
Created: Fri Oct 09, 2026 07:27 AM UTC by Nguyen Tran Trung Hau
Last Updated: Mon Oct 19, 2026 08:27 AM UTC
Owner: Nguyen Tran Trung Hau
osafamfd NULL-pointer dereference at sg.cc:930 - nonmatching DELETE of saAmfSGType on locked SG crashes the active AMF director and reboots the node.
From sg.cc, ccb_apply_modify_hdlr walks the attrMods list of the CCB modify operation. For each mod it sets up 2 things:
void value = nullptr;
...
if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
(attribute->attrValues == nullptr)) {
/ Attribute value is deleted, revert to default value /
value_is_deleted = true; // value stays NULL
} else {
/ Attribute value is modified */
value_is_deleted = false;
value = attribute->attrValues[0];
}
For DELETE mods, value is never assigned, every attribute branch checks value_is_deleted and reverts to a default instead of touching value, except the saAmfSGType:
if (!strcmp(attribute->attrName, "saAmfSGType")) {
SaNameT sg_type_name = ((SaNameT )value); // NULL deref on DELTE
The execution flow for saAmfSGType:
and does "continue" (sg.cc:617-618) — DELETE approved unchecked.
(sg.cc:919-927).
value without checking value_is_deleted (sg.cc:929-930):
"SaNameT sg_type_name = ((SaNameT )value)" — NULL deref.
calls opensaf_reboot() — the node reboots. rc=0 at the client because
immModel_ccbCommit completes before the apply upcall reaches the OI.
Test scenario:
reject admin operations)
Expected: CCB rejected with a validation error.
Observed: "The system is going down for reboot NOW!" —
amfd SIGSEGV, nid reboots the node.
Reproduced output:
1. create an empty SG:
SC-2-1:~ # immcfg -c SaAmfSG \
-a 'saAmfSGType=safVersion=4.0.0,safSgType=OpenSafSgTypeNoRed' \
safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=1
2. lock the SG
SC-2-1:~ # immadm -o 2 safSg=repro930,safApp=safAmfService
SC-2-1:~ # immlist -a saAmfSGAdminState safSg=repro930,safApp=safAmfService
saAmfSGAdminState=2
3. delete a value that isn't there (SG is NoRed, delete 2N)
SC-2-1:~ # immcfg -a 'saAmfSGType-=safVersion=4.0.0,safSgType=OpenSafSgType2N' \
The same single command also crashes saAmfSUType and saAmfCompType:
NO admin-state gate: crashes in any SU state.
no comptype, avd_comptype_add_comp() derefs comp->comp_type=NULL.
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Related
Tickets:
#3406Tickets: tickets
commit 5ef0f4083826c52de2488fd5a704f12d3ca6051b (HEAD -> develop, origin/develop, ticket-3406)
Author: Hau Tran Trung Nguyen Hau.Nguyen@endava.com
Date: Fri Oct 16 03:58:49 2026 +0000
Hi Mohan,
Yes, it's not just sg.cc. The same pattern crashes saAmfSUType and saAmfCompType too (NULL deref at su.cc:2064, osafassert at comp.cc), and saAmfCSType doesn't crash but quietly retypes the CSI to the DN being deleted.
All of those are covered by the new patch already.
Regards,
Hau