Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

check sandbox pointers in virtcontainers internal functions #280

@bergwolf

Description

@bergwolf

From @jodh-intel:

I'd honestly take the opposite approach and not trust anything! 😄

imho we need to "fail fast" since if we start trusting ourselves, we get into horrible situations where func1 calls func2 calls funcN, and funcN explodes because func1 forgot to check if sandbox == nil. That makes debugging very difficult. This is not theoretical - we've been in that situation before in the very early days of vc which prompted me to raise PRs such as containers/virtcontainers#163.

We also have precedent for checking all parameters, for example:

https://github.com/kata-containers/runtime/blob/master/virtcontainers/container.go#L480..L483

IMHO, to make such a change, we need to clarify a few things:

  1. What is the guideline for internal function parameter sanity check? Do we want to check sandbox pointers in every function?
  2. What to do about other parameters? Do we want to make sandbox pointers a special case?

@jodh-intel @sboeuf @egernst please comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    highest-priorityCritically urgent issue (must be resolved as soon as possible)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions