• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ovn-kubernetes / ovn-kubernetes / 24220727612

09 Apr 2026 07:19PM UTC coverage: 57.711% (+0.08%) from 57.636%
24220727612

push

github

jcaamano
Fix nil pointer panic in ParseNetConf for conflist configs

The cluster manager panics on startup when the cluster contains a
non-OVN NetworkAttachmentDefinition that uses the CNI conflist format
(e.g. a bridge or macvlan NAD with a "plugins" array).

During startup, ClusterManager.Start → nadController.syncAll iterates
every NAD and calls ParseNetConf to determine whether it is
OVN-managed. For non-OVN NADs the expected behavior is to return
ErrorAttachDefNotOvnManaged so the caller can skip them. However, a
variable shadowing bug caused the error to be silently lost for
conflist-format NADs, resulting in a nil pointer dereference.

The bug was in this line:

    confList, err := libcni.ConfListFromBytes(bytes)

The := operator declared a new `err` local to the if-block, shadowing
the outer `err` declared at the top of ParseNetConf. When
parseNetConfList returned (nil, ErrorAttachDefNotOvnManaged), that
error was assigned to the inner `err`. The outer `err` remained nil,
so the nil-check at the end of the function passed, and the code
proceeded to dereference the nil `netconf` pointer at
`netconf.Topology`, causing a SIGSEGV.

The fix changes := to = so that both ConfListFromBytes and
parseNetConfList assign to the outer `err`, allowing the error to
propagate correctly.

Panic stack trace:

  panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x1be29b3]

  goroutine 7933 [running]:
  github.com/ovn-kubernetes/ovn-kubernetes/go-controller/pkg/config.ParseNetConf({0xc006af0a50, 0x4c, 0x50})
  	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/config/cni.go:104 +0xd3
  github.com/ovn-kubernetes/ovn-kubernetes/go-controller/pkg/util.ParseNetConf(0xc005a61200)
  	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/util/multi_network.go:1504 +0x3c
  github.com/ovn-kubernetes/ovn-kubernetes/go-controller/pkg/util.ParseNADInfo(0xc005a61200)
  	/go/src/g... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

196 existing lines in 5 files now uncovered.

49566 of 85886 relevant lines covered (57.71%)

375.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.53
/go-controller/pkg/util/net_linux.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc