-
Notifications
You must be signed in to change notification settings - Fork 3.4k
cilium: encryption, segfaults if existing non-Cilium xfrm policy without mark set exists #10268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If an existing encryption (ipsec) is in place and that policy does not have a mark field in the netlink message set then the policy list API will have a nil mark pointer. However, we immediately dereference that pointer to check if its a Cilium installed policy without checking for nil first. The result is the following segfault. [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x1c853df] goroutine 1 [running]: github.com/cilium/cilium/pkg/datapath/linux/ipsec.isXfrmPolicyCilium(...) /go/src/github.com/cilium/cilium/pkg/datapath/linux/ipsec/ipsec_linux.go:367 github.com/cilium/cilium/pkg/datapath/linux/ipsec.DeleteXfrm() /go/src/github.com/cilium/cilium/pkg/datapath/linux/ipsec/ipsec_linux.go:393 +0x10f github.com/cilium/cilium/pkg/datapath/linux.(*linuxNodeHandler).NodeConfigur Add nil pointer checks here to resolve this. Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Release note label not set, please set the appropriate release note. |
2 similar comments
Release note label not set, please set the appropriate release note. |
Release note label not set, please set the appropriate release note. |
test-me-please |
Full example of output from a Slack user:
|
I don't think it's possible to backport wthout #9649 |
Indeed, can't backport to v1.6 without this one. |
If an existing encryption (ipsec) is in place and that policy does not
have a mark field in the netlink message set then the policy list API
will have a nil mark pointer.
However, we immediately dereference that pointer to check if its a
Cilium installed policy without checking for nil first. The result
is the following segfault.
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x1c853df]
goroutine 1 [running]:
github.com/cilium/cilium/pkg/datapath/linux/ipsec.isXfrmPolicyCilium(...)
/go/src/github.com/cilium/cilium/pkg/datapath/linux/ipsec/ipsec_linux.go:367
github.com/cilium/cilium/pkg/datapath/linux/ipsec.DeleteXfrm()
/go/src/github.com/cilium/cilium/pkg/datapath/linux/ipsec/ipsec_linux.go:393 +0x10f
github.com/cilium/cilium/pkg/datapath/linux.(*linuxNodeHandler).NodeConfigur
Add nil pointer checks here to resolve this.
Signed-off-by: John Fastabend john.fastabend@gmail.com
This change is