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

Deal with the case where the kernel supports a higher Landlock version than known to go-landlock #13

Closed
gnoack opened this issue Aug 27, 2021 · 5 comments

Comments

@gnoack
Copy link
Collaborator

gnoack commented Aug 27, 2021

Deal with the case where the kernel supports a higher Landlock version than known to go-landlock.

@gnoack
Copy link
Collaborator Author

gnoack commented Aug 27, 2021

First part: 9b36fb9 (just assume it's the highest Landlock ABI version known to go-landlock)

@gnoack
Copy link
Collaborator Author

gnoack commented Aug 27, 2021

Specific scenario:

  • When HandledAccessFS becomes user-configurable (Make the handledAccessFS set configurable. #12), users may pass values that `go-landlock doesn't know about yet
  • The library might run on a kernel supporting a higher (unknown) go-landlock ABI version.

Option: Maybe it should just be a strict error to pass in HandledAccessFS flags that go-landlock doesn't know about yet. If the HandledAccessFS flags are always within the known set, it doesn't matter if the kernel supports a newer version, but using the go-landlock-supported ABI versions will suffice. The library will need to be upgraded to support higher ABI versions.

@gnoack
Copy link
Collaborator Author

gnoack commented Aug 28, 2021

Addressed in 4e4877f

Constructing a Config with unknown HandledAccessFS flag values is made impossible in the constructor for the Config struct, and so it's more naturally clear that users need to upgrade go-landlock in order to use Landlock features that belong to higher Landlock ABI versions.

@gnoack gnoack closed this as completed Aug 28, 2021
@l0kod
Copy link
Member

l0kod commented Aug 30, 2021

Note about MustConfig: 4e4877f#r55652317

@gnoack
Copy link
Collaborator Author

gnoack commented Aug 30, 2021

Thanks, I appreciate the review (answered to the comment inline).

I have thought a bit about how this API can evolve when Landlock supports non-filesystem restrictions at some point. I think this is reasonable to do without surprising users. I'll try to write it up (tracking in #16) and run it by you.

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

No branches or pull requests

2 participants