Skip to content
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

Treat nil value on SecurityContext.ReadOnlyRootFilesystem as false #27

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

welteki
Copy link
Member

@welteki welteki commented Nov 17, 2023

Description

Add nil check when dereferencing SecurityContext.ReadOnlyRootFilesystem and
treat nil value on SecurityContext.ReadOnlyRootFilesystem as false.

Motivation and Context

  • I have raised an issue to propose this change (required)
  • My issue has received approval from the maintainers or lead with the design/approved label

This should fix a nil pointer dereference reported by a customer.

How Has This Been Tested?

I was not able to reproduce the nil pointer dereference on any of my cluster but the error reported corresponded with the line that is changed in this PR.

OpenFaaS Pro Report
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11bea09]

goroutine 1 [running]:
main.readFunctions({0xc0004ea000?, 0x11, 0x0?})
/go/src/[github.com/openfaas/checker/main.go:891](http://github.com/openfaas/checker/main.go:891) +0xc49
main.main()
/go/src/[github.com/openfaas/checker/main.go:423](http://github.com/openfaas/checker/main.go:423) +0x21c5

Verified the config-checker runs successfully on my clusters.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Add nil check when dereferencing SecurityContext.ReadOnlyRootFilesystem.
This should fix a nil pointer dereference reported by a customer.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@alexellis alexellis merged commit 31d9d6b into openfaas:master Nov 17, 2023
1 check passed
@welteki welteki deleted the fix-nil-pointer branch November 17, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants