Unable to modify open file descriptor limit on Void Linux guest

I’ve tried a few things in order to increase this limit within the container. I started out with the obvious by increasing it in the host (also Void Linux, if it matters) by writing to /etc/security/limits.conf and also by doing what’s described in this Reddit comment thread. That didn’t work, so I did the same in the guest, and that didn’t work either. After that, I modified the config key limits.kernel.nofile and set it to the same values as in the host, and that was a no go as well. After some thinking, I came to the conclusion that the blame must be on PAM somehow, and this belief strengthened when I tried out sudo and got

sudo: pam_open_session: Permission denied
sudo: policy plugin failed session initialization

I have no idea where to go from here, though. I did happen to find a thread which had a similar issue, but I didn’t find a concrete solution.

Edit: One more detail, setting this limit on the host works just fine, but given that it fails on the guest, I felt it was appropiate to post this here and not elsewhere.