Bug 1786477 - non-namespaced cr NetworkAddonsConfig is owned by namespaced cr HCO
Summary: non-namespaced cr NetworkAddonsConfig is owned by namespaced cr HCO
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Networking
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 2.2.0
Assignee: omergi
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-25 15:46 UTC by Asher Shoshan
Modified: 2020-01-30 16:27 UTC (History)
5 users (show)

Fixed In Version: hco-bundle-registry-container-v2.2.0-225
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-30 16:27:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:0307 0 None None None 2020-01-30 16:27:52 UTC

Description Asher Shoshan 2019-12-25 15:46:47 UTC
HCO Operator in namespace openshift-cnv is triggered by cr 'hyperconverged-cluster' (kind HCO) creates non-namespaced cr 'cluster' (kind NetworkAddonsConfig).
hyperconverged-cluster (namespaced) is the owner of 'cluster' (non-namespaced).
This cross-namespace ownership may lead to GC deletions of resources.

See
Bug 1693905 (CVE-2019-3884) - CVE-2019-3884 atomic-openshift:
cross-namespace owner references can trigger deletions of valid children


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

How reproducible:


Steps to Reproduce:
1. install CNV
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Meni Yakove 2020-01-08 09:49:31 UTC
To verify:

1. install CNV
2. Make sure all network-related components were installed.
3. Remove HCO CRd.
4. Make sure all network components besides the network addon operator and the network addon CRDs were removed.

Comment 2 Yan Du 2020-01-13 06:48:43 UTC
Client Version: 4.3.0-0.nightly-2020-01-08-181129
Server Version: 4.3.0-0.nightly-2020-01-08-181129
Kubernetes Version: v1.16.2
CNV 2.2

After removing hco crd, all the network components resources including the network addon crds are all removed.

Comment 3 Maya Rashish 2020-01-13 08:34:05 UTC
(In reply to Yan Du from comment #2)
> After removing hco crd, all the network components resources including the
> network addon crds are all removed.

I believe this is behaviour we want to keep.

The flaw is that it used to be done via ownerReferences.
(`kubectl get NetworkAddonsConfig -o yaml | grep -C 5 ownerReferences`)

The ownerReferences weren't legal (cluster scoped object owned by namespaced object).
Because of this, the deletion might happen when the garbage collector runs. That is, without any user interaction.

Comment 5 errata-xmlrpc 2020-01-30 16:27:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:0307


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