revokefs: Avoid symlink path traversal out of basefd in simple cases

Use glnx_chaseat to ensure that all the attacker-controlled paths end up
inside the basefd directory.

This requires some new helper functions, which will be used in more
complicated syscalls' implementations in subsequent commits.

[smcv: Separated from a larger commit for better reviewability]
Co-authored-by: Simon McVittie <smcv@collabora.com>
Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-qrwq-7qwx-q9rp
This commit is contained in:
Internal Server Error - Gitea: Git with a cup of tea
500 Internal Server Error

Gitea Version: 1.28.0+dev-477-g8b6ad49a5f