Skip to content

linux: fix readlinkat signed error handling and add regression test#71

Merged
fwsGonzo merged 2 commits intovarnish:masterfrom
jlinenkohl:pr-u8-readlinkat-regression-fix
Apr 22, 2026
Merged

linux: fix readlinkat signed error handling and add regression test#71
fwsGonzo merged 2 commits intovarnish:masterfrom
jlinenkohl:pr-u8-readlinkat-regression-fix

Conversation

@jlinenkohl
Copy link
Copy Markdown
Contributor

@jlinenkohl jlinenkohl commented Apr 20, 2026

Summary

  • Harden SYS_readlinkat guest copy path to avoid wrapped-length copy on host readlinkat() failure
  • Keep syscall return contract behavior unchanged
  • Add a focused unit regression test for the failing readlinkat path

Why

This bug is independently valuable to fix and was discovered while working relocation test lanes.

Validation

  • cd tests && bash ./run_unit_tests.sh -R test_basic

Notes

This is intentionally standalone and separated from relocation/test-gating work.

Copy link
Copy Markdown
Member

@fwsGonzo fwsGonzo left a comment

Choose a reason for hiding this comment

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

The new std::vector on the heap is <= PATH_MAX in size, and is just more costly than a fixed-size PATH_MAX buffer. I think we will keep the fixed-size buffer and read the link contents into that.

@jlinenkohl
Copy link
Copy Markdown
Contributor Author

Agreed. I have made that adjustment.

@jlinenkohl jlinenkohl marked this pull request as ready for review April 21, 2026 21:05
@fwsGonzo fwsGonzo merged commit c6690c8 into varnish:master Apr 22, 2026
4 checks passed
@fwsGonzo
Copy link
Copy Markdown
Member

Thanks!

@jlinenkohl jlinenkohl deleted the pr-u8-readlinkat-regression-fix branch April 22, 2026 22:33
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