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

Extremely long symlinks cannot be handled in reverse mode #167

Closed
slackner opened this issue Nov 23, 2017 · 2 comments
Closed

Extremely long symlinks cannot be handled in reverse mode #167

slackner opened this issue Nov 23, 2017 · 2 comments

Comments

@slackner
Copy link
Contributor

This is not really a critical issue, however it might be useful to document such limitations somewhere and use more meaningful error messages/catch this explicitly.

Steps to reproduce:

  1. Mount a regular reverse mount point
  2. Create a symlink where the target contains 4095 bytes of data (maximum length of ext4)
  3. Try to access the corresponding link in the reverse mount - the symlink appears, but doesn't have a target assigned.

GoCryptFS throws the error message:

2017/11/23 21:15:58 writer: Write/Writev failed, err: 22=invalid argument. opcode: READLINK

The problem is that the encryption and base64 encoding adds a lot of overhead, and the data is apparently too big - not just for ext4, but also for FUSE in general?

@rfjakob
Copy link
Owner

rfjakob commented Nov 25, 2017

Looks like we return too much data to the kernel, which rejects it with EINVAL. We should rather return ENAMETOOLONG ourselves. I'll take a look

rfjakob added a commit that referenced this issue Nov 26, 2017
If the symlink target gets too long due to base64 encoding, we should
return ENAMETOOLONG instead of having the kernel reject the data and
returning and I/O error to the user.

Fixes #167
@slackner
Copy link
Contributor Author

Thanks!

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